def file_must_exist(file_name: str, kind: str = "file") -> Path:
    """
    Check that a file exists, for early validation of pip (etc) arguments.

    Raises an exception if it doesn't exist.  Returns the resolved path if it
    does exist so we can use relative paths and they'll still work once we've
    cd'd to the temporary workspace.
    """
    path = Path(file_name).expanduser().resolve()
    if not path.exists():
        kind = kind[0].upper() + kind[1:]
        raise RuntimeError(f"{kind} {file_name!r} doesn't exist")
    return path

    Check that a file exists, for early validation of pip (etc) arguments.

    Raises an exception if it doesn't exist.  Returns the resolved path if it
    does exist so we can use relative paths and they'll still work once we've
    cd'd to the temporary workspace.
    
benchmark/benchmark.py