code: def testDirSize(self):
      fake_task_uid = 1234
  
      # Create a directory with some files and sub-directory and check its size.
      test_dir = resolver._temp_download_dir(
          self.get_temp_dir(), fake_task_uid
      )
      tf.compat.v1.gfile.MakeDirs(test_dir)
      tf_utils.atomic_write_string_to_file(
          os.path.join(test_dir, "file1"), "content1", False
      )
      tf_utils.atomic_write_string_to_file(
          os.path.join(test_dir, "file2"), "content2", False
      )
      test_sub_dir = os.path.join(test_dir, "sub_dir")
      tf.compat.v1.gfile.MakeDirs(test_sub_dir)
      tf_utils.atomic_write_string_to_file(
          os.path.join(test_sub_dir, "file3"), "content3", False
      )
      self.assertEqual(3 * 8, resolver._dir_size(test_dir))
      self.assertEqual(8, resolver._dir_size(test_sub_dir))
  
      # Treat the directory as a temporary directory used by a module download by
      # referring to that directory from the lock file.
      fake_lock_filename = resolver._lock_filename(self.get_temp_dir())
      tf_utils.atomic_write_string_to_file(
          fake_lock_filename,
          resolver._lock_file_contents(fake_task_uid),
          False,
      )
      self.assertEqual(
          3 * 8, resolver._locked_tmp_dir_size(fake_lock_filename)
      )
  
      # Check that if temp directory doesn't exist, 0 is returned.
      tf.compat.v1.gfile.DeleteRecursively(test_dir)
      self.assertEqual(
          0, resolver._locked_tmp_dir_size(fake_lock_filename)
      )
  
imports: import os
  import re
  import socket
  import tempfile
  import threading
  import time
  import unittest
  from unittest import mock
  import uuid
  from absl import flags
  import tensorflow
  import tensorflow_hub
  from tensorflow_hub import compressed_module_resolver
  from tensorflow_hub import config
  from tensorflow_hub import registry
  from tensorflow_hub import resolver
  from tensorflow_hub import test_utils
  from tensorflow_hub import tf_utils
  from tensorflow_hub import uncompressed_module_resolver
label_desc: Use image node_id 2 for calling the CompressedResolverTest obj's underlying member method code with example usage: obj.testDirSize() without return types