MCPcopy
hub / github.com/huggingface/datasets / is_local_path

Function is_local_path

src/datasets/utils/file_utils.py:79–83  ·  view source on GitHub ↗
(url_or_filename: str)

Source from the content-addressed store, hash-verified

77
78
79def is_local_path(url_or_filename: str) -> bool:
80 # On unix the scheme of a local path is empty (for both absolute and relative),
81 # while on windows the scheme is the drive name (ex: "c") for absolute paths.
82 # for details on the windows behavior, see https://bugs.python.org/issue42215
83 return urlparse(url_or_filename).scheme == "" or os.path.ismount(urlparse(url_or_filename).scheme + ":/")
84
85
86def is_relative_path(url_or_filename: str) -> bool:

Callers 15

_fix_local_version_fileFunction · 0.90
resolve_patternFunction · 0.85
cached_pathFunction · 0.85
xjoinFunction · 0.85
xdirnameFunction · 0.85
xexistsFunction · 0.85
xbasenameFunction · 0.85
xsplitFunction · 0.85
xsplitextFunction · 0.85
xisfileFunction · 0.85
xgetsizeFunction · 0.85

Calls

no outgoing calls