def process_input_path()

in dataflux_pytorch/lightning/path_utils.py [0:0]


def process_input_path(path: Union[str, Path]) -> str:
    if isinstance(path, str):
        return path
    elif isinstance(path, Path):
        # When casting from Path object to string, it considers cloud URLs as Network URLs and gets rid of //
        scheme, rest = str(path).split(":/")
        return str(scheme) + "://" + str(rest)
    else:
        raise TypeError(
            "path argument must be of type string or pathlib.Path object")