MCPcopy Index your code
hub / github.com/tensorflow/datasets / _read_files

Function _read_files

tensorflow_datasets/core/dataset_metadata.py:97–111  ·  view source on GitHub ↗

Reads all metadata files content. Args: path: path to package where metadata files are. Returns: dict {path: content}, where path is relative to the dataset src directory. e.g. {'README.md': '...', 'CITATIONS.cff': '...'}

(path: epath.Path)

Source from the content-addressed store, hash-verified

95
96
97def _read_files(path: epath.Path) -> dict[str, str]:
98 """Reads all metadata files content.
99
100 Args:
101 path: path to package where metadata files are.
102
103 Returns:
104 dict {path: content}, where path is relative to the dataset src directory.
105 e.g. {'README.md': '...', 'CITATIONS.cff': '...'}
106 """
107 name2path = {}
108 for inode in path.iterdir():
109 if inode.name in _METADATA_FILES:
110 name2path[inode.name] = path.joinpath(inode.name)
111 return etree.parallel_map(lambda f: f.read_text(encoding="utf-8"), name2path)

Callers 1

loadFunction · 0.70

Calls 2

iterdirMethod · 0.80
read_textMethod · 0.80

Tested by

no test coverage detected