code: def _extract_archive(file_path, extract_path="."):
      """Extracts an archive."""
      for archive_type in ["zip", "tar"]:
          if archive_type == "zip":
              open_fn = zipfile.ZipFile
              is_match_fn = zipfile.is_zipfile
          elif archive_type == "tar":
              open_fn = tarfile.open
              is_match_fn = tarfile.is_tarfile
  
          if is_match_fn(file_path):
              with open_fn(file_path) as archive:
                  try:
                      archive.extractall(extract_path)
                  except (
                      tarfile.TarError,
                      RuntimeError,
                      KeyboardInterrupt,
                  ):
                      if os.path.exists(extract_path):
                          if os.path.isfile(extract_path):
                              os.remove(extract_path)
                          else:
                              shutil.rmtree(extract_path)
                      raise
  
file_path: cornac/cornac/utils/download.py
imports: import os
  import shutil
  import zipfile
  import tarfile
  from urllib import request
  from tqdm.auto import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: _extract_archive(file_path, extract_path) without return types