code: def extract_tarfile_to_destination(
      fileobj, dst_path, log_function=None
  ):
      """Extract a tarfile. Optional: log the progress."""
      with tarfile.open(mode="r|*", fileobj=fileobj) as tgz:
          for tarinfo in tgz:
              abs_target_path = merge_relative_path(
                  dst_path, tarinfo.name
              )
  
              if tarinfo.isfile():
                  extract_file(
                      tgz,
                      tarinfo,
                      abs_target_path,
                      log_function=log_function,
                  )
              elif tarinfo.isdir():
                  tf.compat.v1.gfile.MakeDirs(abs_target_path)
              else:
                  # We do not support symlinks and other uncommon objects.
                  raise ValueError(
                      "Unexpected object type in tar archive: %s"
                      % tarinfo.type
                  )
  
imports: import os
  import tarfile
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: extract_tarfile_to_destination(fileobj, dst_path, log_function) without return types