code: def _unpack_zipfile(filename, extract_dir):
      """Unpack zip `filename` to `extract_dir`"""
      import zipfile  # late import for breaking circular dependency
  
      if not zipfile.is_zipfile(filename):
          raise ReadError("%s is not a zip file" % filename)
  
      zip = zipfile.ZipFile(filename)
      try:
          for info in zip.infolist():
              name = info.filename
  
              # don't extract absolute paths or ones with .. in them
              if name.startswith("/") or ".." in name:
                  continue
  
              targetpath = os.path.join(extract_dir, *name.split("/"))
              if not targetpath:
                  continue
  
              _ensure_directory(targetpath)
              if not name.endswith("/"):
                  # file
                  with zip.open(name, "r") as source, open(
                      targetpath, "wb"
                  ) as target:
                      copyfileobj(source, target)
      finally:
          zip.close()
  
imports: import os
  import sys
  import stat
  import fnmatch
  import collections
  import errno
label_desc: Use image node_id 36 for calling a global function with example usage: _unpack_zipfile(filename, extract_dir) without return types