MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _extract_zip

Function _extract_zip

monai/apps/utils.py:277–286  ·  view source on GitHub ↗
(filepath, output_dir)

Source from the content-addressed store, hash-verified

275
276
277def _extract_zip(filepath, output_dir):
278 with zipfile.ZipFile(filepath, "r") as zip_file:
279 for member in zip_file.infolist():
280 safe_path = safe_extract_member(member, output_dir)
281 if member.is_dir():
282 continue
283 os.makedirs(os.path.dirname(safe_path), exist_ok=True)
284 with zip_file.open(member) as source:
285 with open(safe_path, "wb") as target:
286 shutil.copyfileobj(source, target)
287
288
289def _extract_tar(filepath, output_dir):

Callers 2

extractallFunction · 0.85

Calls 1

safe_extract_memberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…