code: def extract_archive(file, target_dir, overwrite=True):
      """Extract archive file.
  
      Parameters
      ----------
      file : str
          Absolute path of the archive file.
      target_dir : str
          Target directory of the archive to be uncompressed.
      overwrite : bool, default True
          Whether to overwrite the contents inside the directory.
          By default always overwrites.
      """
      if os.path.exists(target_dir) and not overwrite:
          return
      print("Extracting file to {}".format(target_dir))
      if (
          file.endswith(".tar.gz")
          or file.endswith(".tar")
          or file.endswith(".tgz")
      ):
          import tarfile
  
          with tarfile.open(file, "r") as archive:
  
              def is_within_directory(directory, target):
                  abs_directory = os.path.abspath(directory)
                  abs_target = os.path.abspath(target)
                  prefix = os.path.commonprefix(
                      [abs_directory, abs_target]
                  )
                  return prefix == abs_directory
  
              def safe_extract(
                  tar, path=".", members=None, *, numeric_owner=False
              ):
                  for member in tar.getmembers():
                      member_path = os.path.join(path, member.name)
                      if not is_within_directory(path, member_path):
                          raise Exception(
                              "Attempted Path Traversal in Tar File"
                          )
                  tar.extractall(
                      path, members, numeric_owner=numeric_owner
                  )
  
              safe_extract(archive, path=target_dir)
      elif file.endswith(".gz"):
          import gzip
          import shutil
  
          with gzip.open(file, "rb") as f_in:
              target_file = os.path.join(
                  target_dir, os.path.basename(file)[:-3]
              )
              with open(target_file, "wb") as f_out:
                  shutil.copyfileobj(f_in, f_out)
      elif file.endswith(".zip"):
          import zipfile
  
          with zipfile.ZipFile(file, "r") as archive:
              archive.extractall(path=target_dir)
      else:
          raise Exception("Unrecognized file type: " + file)
  
imports: from __future__ import absolute_import
  import errno
  import hashlib
  import os
  import pickle
  import sys
  import warnings
  import networkx.algorithms
  import numpy
  import requests
  from tqdm import tqdm
  from ..None import backend
  from .graph_serialize import load_graphs, load_labels, save_graphs
  from .tensor_serialize import load_tensors, save_tensors
label_desc: Use image node_id 6 for calling a global function with example usage: extract_archive(file, target_dir, overwrite) and returns: unknown