code: def extract_archive(file_path, path=".", archive_format="auto"):
      """Extracts an archive if it matches a support format.
  
      Supports `.tar`, `.tar.gz`, `.tar.bz`, and `.zip` formats.
  
      Args:
          file_path: Path to the archive file.
          path: Where to extract the archive file.
          archive_format: Archive format to try for extracting the file.
              Options are `"auto"`, `"tar"`, `"zip"`, and `None`.
              `"tar"` includes `.tar`, `.tar.gz`, and `.tar.bz` files.
              The default `"auto"` uses `["tar", "zip"]`.
              `None` or an empty list will return no matches found.
  
      Returns:
          `True` if a match was found and an archive extraction was completed,
          `False` otherwise.
      """
      if archive_format is None:
          return False
      if archive_format == "auto":
          archive_format = ["tar", "zip"]
      if isinstance(archive_format, str):
          archive_format = [archive_format]
  
      file_path = path_to_string(file_path)
      path = path_to_string(path)
  
      for archive_type in archive_format:
          if archive_type == "tar":
              open_fn = tarfile.open
              is_match_fn = tarfile.is_tarfile
          if archive_type == "zip":
              open_fn = zipfile.ZipFile
              is_match_fn = zipfile.is_zipfile
  
          if is_match_fn(file_path):
              with open_fn(file_path) as archive:
                  try:
                      if zipfile.is_zipfile(file_path):
                          # Zip archive.
                          archive.extractall(path)
                      else:
                          # Tar archive, perhaps unsafe. Filter paths.
                          archive.extractall(
                              path, members=filter_safe_paths(archive)
                          )
                  except (
                      tarfile.TarError,
                      RuntimeError,
                      KeyboardInterrupt,
                  ):
                      if os.path.exists(path):
                          if os.path.isfile(path):
                              os.remove(path)
                          else:
                              shutil.rmtree(path)
                      raise
              return True
      return False
  
imports: import hashlib
  import os
  import pathlib
  import re
  import shutil
  import tarfile
  import urllib
  import warnings
  import zipfile
  from urllib.request import urlretrieve
  from keras.api_export import keras_export
  from keras.backend import config
  from keras.utils import io_utils
  from keras.utils.module_utils import gfile
  from keras.utils.progbar import Progbar
label_desc: Use image node_id 6 for calling a global function with example usage: extract_archive(file_path, path, archive_format) and returns: False, False, True