code: def _unpack_zipfile_obj(
      zipfile_obj, extract_dir, progress_filter=default_filter
  ):
      """Internal/private API used by other parts of setuptools.
      Similar to ``unpack_zipfile``, but receives an already opened :obj:`zipfile.ZipFile`
      object instead of a filename.
      """
      for info in zipfile_obj.infolist():
          name = info.filename
  
          # don't extract absolute paths or ones with .. in them
          if name.startswith("/") or ".." in name.split("/"):
              continue
  
          target = os.path.join(extract_dir, *name.split("/"))
          target = progress_filter(name, target)
          if not target:
              continue
          if name.endswith("/"):
              # directory
              ensure_directory(target)
          else:
              # file
              ensure_directory(target)
              data = zipfile_obj.read(info.filename)
              with open(target, "wb") as f:
                  f.write(data)
          unix_attributes = info.external_attr >> 16
          if unix_attributes:
              os.chmod(target, unix_attributes)
  
file_path: catboost/contrib/python/setuptools/py3/setuptools/archive_util.py
imports: import zipfile
  import tarfile
  import os
  import shutil
  import posixpath
  import contextlib
  from distutils.errors import DistutilsError
  from ._path import ensure_directory
label_desc: Use image node_id 5 for calling a global function with example usage: _unpack_zipfile_obj(zipfile_obj, extract_dir, progress_filter) without return types