code: def testCacheDir(self):
      # No cache dir set, None is returned.
      cache_dir = resolver.tfhub_cache_dir()
      self.assertEqual(cache_dir, None)
      # Use temp dir.
      cache_dir = resolver.tfhub_cache_dir(use_temp=True)
      self.assertEquals(
          cache_dir,
          os.path.join(tempfile.gettempdir(), "tfhub_modules"),
      )
      # Use override
      cache_dir = resolver.tfhub_cache_dir(
          default_cache_dir="/d", use_temp=True
      )
      self.assertEqual("/d", cache_dir)
      # Use a flag
      FLAGS.tfhub_cache_dir = "/e"
      cache_dir = resolver.tfhub_cache_dir(
          default_cache_dir="/d", use_temp=True
      )
      self.assertEqual("/e", cache_dir)
      FLAGS.tfhub_cache_dir = ""
      # Use env variable
      os.environ[resolver._TFHUB_CACHE_DIR] = "/f"
      cache_dir = resolver.tfhub_cache_dir(
          default_cache_dir="/d", use_temp=True
      )
      self.assertEqual("/f", cache_dir)
      FLAGS.tfhub_cache_dir = "/e"
      cache_dir = resolver.tfhub_cache_dir(
          default_cache_dir="/d", use_temp=True
      )
      self.assertEqual("/f", cache_dir)
      FLAGS.tfhub_cache_dir = ""
      os.unsetenv(resolver._TFHUB_CACHE_DIR)
  
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 1 for calling the CompressedResolverTest obj's underlying member method code with example usage: obj.testCacheDir() without return types