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

Method ls

tests/test_file_utils.py:275–287  ·  view source on GitHub ↗
(self, path, detail=True, refresh=True, **kwargs)

Source from the content-addressed store, hash-verified

273 raise IndexError(f"{name} not found!")
274
275 def ls(self, path, detail=True, refresh=True, **kwargs):
276 if kwargs.pop("strip_proto", True):
277 path = self._strip_protocol(path)
278
279 files = not refresh and self._ls_from_cache(path)
280 if not files:
281 files = [file for file in self._fs_contents if path == self._parent(file["name"])]
282 files.sort(key=lambda file: file["name"])
283 self.dircache[path.rstrip("/")] = files
284
285 if detail:
286 return files
287 return [file["name"] for file in files]
288
289 def _open(
290 self,

Callers

nothing calls this directly

Calls 2

_strip_protocolMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected