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

Method extract

src/datasets/utils/extract.py:128–132  ·  view source on GitHub ↗
(input_path: Union[Path, str], output_path: Union[Path, str])

Source from the content-addressed store, hash-verified

126
127 @staticmethod
128 def extract(input_path: Union[Path, str], output_path: Union[Path, str]) -> None:
129 os.makedirs(output_path, exist_ok=True)
130 tar_file = tarfile.open(input_path)
131 tar_file.extractall(output_path, members=TarExtractor.safemembers(tar_file, output_path))
132 tar_file.close()
133
134
135class GzipExtractor(MagicNumberBaseExtractor):

Callers

nothing calls this directly

Calls 4

makedirsMethod · 0.80
openMethod · 0.80
closeMethod · 0.80
safemembersMethod · 0.45

Tested by

no test coverage detected