(path, env)
return None
Create a PrefixRelative item inferring a suitable prefix name and relpath.

    Parameters
    ----------
    path : str
        File system path.
    env : List[Tuple[str, str]]
        A sequence of (NAME, basepath) pairs. The sequence is searched
        for a item such that basepath/relpath == path and the
        VarPath(NAME, relpath) is returned.
        (note: the first matching prefixed path is chosen).

    Returns
    -------
    varpath : VarPath
Create a PrefixRelative item inferring a suitable prefix name and relpath.
Create a PrefixRelative item inferring a suitable prefix name and relpath .
def infer_prefix(path, env) -> Optional[VarPath]:
    """
    Create a PrefixRelative item inferring a suitable prefix name and relpath.

    Parameters
    ----------
    path : str
        File system path.
    env : List[Tuple[str, str]]
        A sequence of (NAME, basepath) pairs. The sequence is searched
        for a item such that basepath/relpath == path and the
        VarPath(NAME, relpath) is returned.
        (note: the first matching prefixed path is chosen).

    Returns
    -------
    varpath : VarPath
    """
    abspath = os.path.abspath(path)
    for sname, basepath in env:
        if isprefixed(basepath, abspath):
            relpath = os.path.relpath(abspath, basepath)
            return VarPath(sname, relpath)
    return None
def infer_prefix ( path , env ) -> Optional [ VarPath ] : abspath = os . path . abspath ( path ) for sname , basepath in env : if isprefixed ( basepath , abspath ) : relpath = os . path . relpath ( abspath , basepath ) return VarPath ( sname , relpath ) return None