code: def extract_dep(url: str, filename: str) -> None:
      import tarfile
      import zipfile
  
      file = os.path.join(args.depends_dir, filename)
      if not os.path.exists(file):
          # First try our mirror
          mirror_url = (
              f"https://raw.githubusercontent.com/"
              f"python-pillow/pillow-depends/main/{filename}"
          )
          try:
              download_dep(mirror_url, file)
          except RuntimeError as exc:
              # Otherwise try upstream
              print(exc)
              download_dep(url, file)
  
      print("Extracting " + filename)
      sources_dir_abs = os.path.abspath(sources_dir)
      if filename.endswith(".zip"):
          with zipfile.ZipFile(file) as zf:
              for member in zf.namelist():
                  member_abspath = os.path.abspath(
                      os.path.join(sources_dir, member)
                  )
                  member_prefix = os.path.commonpath(
                      [sources_dir_abs, member_abspath]
                  )
                  if sources_dir_abs != member_prefix:
                      msg = "Attempted Path Traversal in Zip File"
                      raise RuntimeError(msg)
              zf.extractall(sources_dir)
      elif filename.endswith((".tar.gz", ".tgz")):
          with tarfile.open(file, "r:gz") as tgz:
              for member in tgz.getnames():
                  member_abspath = os.path.abspath(
                      os.path.join(sources_dir, member)
                  )
                  member_prefix = os.path.commonpath(
                      [sources_dir_abs, member_abspath]
                  )
                  if sources_dir_abs != member_prefix:
                      msg = "Attempted Path Traversal in Tar File"
                      raise RuntimeError(msg)
              tgz.extractall(sources_dir)
      else:
          msg = "Unknown archive type: " + filename
          raise RuntimeError(msg)
  
imports: from __future__ import annotations
  import argparse
  import os
  import platform
  import re
  import shutil
  import struct
  import subprocess
label_desc: Use image node_id 13 for calling a global function with example usage: extract_dep(url, filename) without return types