code: def _extract(full_path: str, path: str) -> bool:
      archive: Union[zipfile.ZipFile, tarfile.TarFile]
      if full_path.endswith("tar"):  # pragma: no cover
          if tarfile.is_tarfile(full_path):
              archive = tarfile.open(full_path, "r:")
      elif full_path.endswith("tar.gz"):  # pragma: no cover
          if tarfile.is_tarfile(full_path):
              archive = tarfile.open(full_path, "r:gz")
      elif full_path.endswith("zip"):  # pragma: no cover
          if zipfile.is_zipfile(full_path):
              archive = zipfile.ZipFile(
                  full_path
              )  # pylint: disable=R1732
          else:
              return False
      else:
          return False
  
      try:
          archive.extractall(path)
      except (
          tarfile.TarError,
          RuntimeError,
          KeyboardInterrupt,
      ):  # pragma: no cover
          if os.path.exists(path):
              if os.path.isfile(path):
                  os.remove(path)
              else:
                  shutil.rmtree(path)
          raise
      return True
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import math
  import os
  import shutil
  import sys
  import tarfile
  import warnings
  import zipfile
  from functools import wraps
  from inspect import signature
  from typing import TYPE_CHECKING, Callable, List, Dict, Optional, Tuple, Union
  import numpy
  import six
  from scipy.special import gammainc
  from tqdm.auto import tqdm
  from art import config
label_desc: Use image node_id 35 for calling a global function with example usage: _extract(full_path, path) and returns: True, False, False