code: def extract_criteo(size, compressed_file, path=None):
      """Extract Criteo dataset tar.
  
      Args:
          size (str): Size of Criteo dataset. It can be "full" or "sample".
          compressed_file (str): Path to compressed file.
          path (str): Path to extract the file.
  
      Returns:
          str: Path to the extracted file.
  
      """
      if path is None:
          folder = os.path.dirname(compressed_file)
          extracted_dir = os.path.join(folder, "dac")
      else:
          extracted_dir = path
  
      with tarfile.open(compressed_file) as tar:
  
          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(tar, extracted_dir)
  
      filename_selector = {
          "sample": "dac_sample.txt",
          "full": "train.txt",
      }
      return os.path.join(extracted_dir, filename_selector[size])
  
file_path: recommenders/recommenders/datasets/criteo.py
imports: import pandas
  import os
  import tarfile
  from recommenders.datasets.download_utils import maybe_download, download_path
  from recommenders.utils.notebook_utils import is_databricks
label_desc: Use image node_id 4 for calling a global function with example usage: extract_criteo(size, compressed_file, path) and returns: os, unknown