code: def test_file_extraction(self):
      # Compress, extract and compare the following directory:
      # /a:               content1
      # /sub_directory/b: content2
  
      gfile = tf.compat.v1.gfile
      outer_file = "a"
      outer_content = "content1"
      dir_name = "sub_directory"
      inner_file = "b"
      inner_content = "content2"
      local_archive = tempfile.mktemp()
  
      with tempfile.TemporaryDirectory() as temp_dir:
          with gfile.GFile(
              os.path.join(temp_dir, outer_file), "w"
          ) as f:
              f.write(outer_content)
          directory_path = os.path.join(temp_dir, dir_name)
          os.mkdir(directory_path)
          with gfile.GFile(
              os.path.join(directory_path, inner_file), "w"
          ) as f:
              f.write(inner_content)
          with gfile.Open(local_archive, "wb") as f:
              tfjs_tarfile = tarfile.open(mode="w:gz", fileobj=f)
              tfjs_tarfile.add(temp_dir, arcname="/")
              tfjs_tarfile.close()
  
      extraction_dir = tempfile.mkdtemp()
      with gfile.GFile(local_archive, "rb") as fileobj:
          file_utils.extract_tarfile_to_destination(
              fileobj, extraction_dir
          )
  
      self.assertCountEqual(
          gfile.ListDirectory(extraction_dir), [outer_file, dir_name]
      )
      self.assertEqual(
          gfile.Open(os.path.join(extraction_dir, outer_file)).read(),
          outer_content,
      )
      self.assertCountEqual(
          gfile.ListDirectory(os.path.join(extraction_dir, dir_name)),
          [inner_file],
      )
      self.assertEqual(
          gfile.Open(
              os.path.join(extraction_dir, dir_name, inner_file)
          ).read(),
          inner_content,
      )
  
file_path: hub/tensorflow_hub/file_utils_test.py
imports: import os
  import tarfile
  import tempfile
  import tensorflow
  from tensorflow_hub import file_utils
label_desc: Use image node_id 2 for calling the FileUtilsTest obj's underlying member method code with example usage: obj.test_file_extraction() without return types