code: def extract_tar(path, folder, mode="r:gz", log=True):
      r"""Extracts a tar archive to a specific folder.
  
      Args:
          path (string): The path to the tar archive.
          folder (string): The folder.
          mode (string, optional): The compression mode. (default: :obj:`"r:gz"`)
          log (bool, optional): If :obj:`False`, will not print anything to the
              console. (default: :obj:`True`)
      """
      maybe_log(path, log)
      with tarfile.open(path, mode) as f:
          f.extractall(folder)
  
file_path: AutoGL/autogl/data/extract.py
imports: from __future__ import print_function
  import os.path
  import tarfile
  import zipfile
  import bz2
  import gzip
label_desc: Use image node_id 2 for calling a global function with example usage: extract_tar(path, folder, mode, log) without return types