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

Method extract

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

Source from the content-addressed store, hash-verified

220
221 @staticmethod
222 def extract(input_path: Union[Path, str], output_path: Union[Path, str]) -> None:
223 os.makedirs(output_path, exist_ok=True)
224 with zipfile.ZipFile(input_path, "r") as zip_file:
225 zip_file.extractall(output_path, members=ZipExtractor.safemembers(zip_file.filelist, output_path))
226 zip_file.close()
227
228
229class XzExtractor(MagicNumberBaseExtractor):

Callers

nothing calls this directly

Calls 3

makedirsMethod · 0.80
closeMethod · 0.80
safemembersMethod · 0.45

Tested by

no test coverage detected