code: def untar(path, fname, delete=True, flatten_tar=False):
      """
      Unpack the given archive file to the same directory.
  
      :param str path:
          The folder containing the archive. Will contain the contents.
  
      :param str fname:
          The filename of the archive file.
  
      :param bool delete:
          If true, the archive will be deleted after extraction.
      """
      if ".zip" in fname:
          return _unzip(path, fname, delete=delete)
      else:
          return _untar(path, fname, delete=delete, flatten=flatten_tar)
  
imports: import importlib
  import json
  import time
  import datetime
  import os
  import requests
  import shutil
  import hashlib
  import tqdm
  import gzip
  import math
  import contextlib
  import parlai.utils.logging
  from parlai.utils.io import PathManager
label_desc: Use image node_id 6 for calling a global function with example usage: untar(path, fname, delete, flatten_tar) and returns: _unzip, _untar