code: def extract_archive(from_path, to_path=None, overwrite=False):
      """Extract archive.
  
      Args:
          from_path: the path of the archive.
          to_path: the root path of the extracted files (directory of from_path)
          overwrite: overwrite existing files (False)
  
      Returns:
          List of paths to extracted files even if not overwritten.
  
      Examples:
          >>> url = 'http://www.quest.dcs.shef.ac.uk/wmt16_files_mmt/validation.tar.gz'
          >>> from_path = './validation.tar.gz'
          >>> to_path = './'
          >>> torchtext.utils.download_from_url(url, from_path)
          >>> torchtext.utils.extract_archive(from_path, to_path)
          >>> ['.data/val.de', '.data/val.en']
          >>> torchtext.utils.download_from_url(url, from_path)
          >>> torchtext.utils.extract_archive(from_path, to_path)
          >>> ['.data/val.de', '.data/val.en']
  
      """
  
      if to_path is None:
          to_path = os.path.dirname(from_path)
  
      if from_path.endswith((".tar.gz", ".tgz")):
          logging.info(
              "Opening tar file {} to {}.".format(from_path, to_path)
          )
          with tarfile.open(from_path, "r") as tar:
              files = []
              for file_ in tqdm(tar):
                  file_path = os.path.join(to_path, file_.name)
                  if file_.isfile():
                      files.append(file_path)
                      if os.path.exists(file_path):
                          logging.info(
                              "{} already extracted.".format(file_path)
                          )
                          if not overwrite:
                              continue
                  tar.extract(file_, to_path)
              logging.info(
                  "Finished extracting tar file {}.".format(from_path)
              )
              return files
  
      elif from_path.endswith(".zip"):
          assert zipfile.is_zipfile(from_path), from_path
          logging.info(
              "Opening zip file {} to {}.".format(from_path, to_path)
          )
          with zipfile.ZipFile(from_path, "r") as zfile:
              files = []
              for file_ in tqdm(zfile.namelist()):
                  file_path = os.path.join(to_path, file_)
                  files.append(file_path)
                  if os.path.exists(file_path):
                      logging.info(
                          "{} already extracted.".format(file_path)
                      )
                      if not overwrite:
                          continue
                  zfile.extract(file_, to_path)
          files = [f for f in files if os.path.isfile(f)]
          logging.info(
              "Finished extracting zip file {}.".format(from_path)
          )
          return files
  
      elif from_path.endswith(".gz"):
          logging.info(
              "Opening gz file {} to {}.".format(from_path, to_path)
          )
          default_block_size = 65536
          filename = from_path[:-3]
          files = [filename]
          with gzip.open(from_path, "rb") as gzfile, open(
              filename, "wb"
          ) as d_file:
              while True:
                  block = gzfile.read(default_block_size)
                  if not block:
                      break
                  else:
                      d_file.write(block)
              d_file.write(block)
          logging.info(
              "Finished extracting gz file {}.".format(from_path)
          )
          return files
  
      else:
          raise NotImplementedError(
              "We currently only support tar.gz, .tgz, .gz and zip achives."
          )
  
imports: import gzip
  import logging
  import os
  import random
  import tarfile
  import zipfile
  import cv2
  import decord
  import webdataset
  import numpy
  import torch
  from torch.utils.data.dataset import IterableDataset, ChainDataset
  from decord import VideoReader
  from lavis.common.registry import registry
  from lavis.datasets.datasets.base_dataset import ConcatDataset
  from tqdm import tqdm
label_desc: Use image node_id 7 for calling a global function with example usage: extract_archive(from_path, to_path, overwrite) and returns: files, files, files