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

Method exists

src/datasets/utils/file_utils.py:1105–1114  ·  view source on GitHub ↗

Extend `pathlib.Path.exists` method to support both local and remote files. Args: download_config : mainly use token or storage_options to support different platforms and auth types. Returns: `bool`

(self, download_config: Optional[DownloadConfig] = None)

Source from the content-addressed store, hash-verified

1103 return path_as_posix
1104
1105 def exists(self, download_config: Optional[DownloadConfig] = None):
1106 """Extend `pathlib.Path.exists` method to support both local and remote files.
1107
1108 Args:
1109 download_config : mainly use token or storage_options to support different platforms and auth types.
1110
1111 Returns:
1112 `bool`
1113 """
1114 return xexists(str(self), download_config=download_config)
1115
1116 def glob(self, pattern, download_config: Optional[DownloadConfig] = None):
1117 """Glob function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.

Callers 15

write_to_directoryMethod · 0.80
from_directoryMethod · 0.80
__init__Method · 0.80
download_and_prepareMethod · 0.80
incomplete_dirMethod · 0.80
as_datasetMethod · 0.80
mapMethod · 0.80
_map_singleMethod · 0.80

Calls 1

xexistsFunction · 0.85