code: def GetTempDir():
      """Return a temporary directory for tests to use."""
      global _googletest_temp_dir
      if not _googletest_temp_dir:
          if os.environ.get("TEST_TMPDIR"):
              temp_dir = tempfile.mkdtemp(
                  prefix=os.environ["TEST_TMPDIR"]
              )
          else:
              first_frame = tf_inspect.stack()[-1][0]
              temp_dir = os.path.join(
                  tempfile.gettempdir(),
                  os.path.basename(tf_inspect.getfile(first_frame)),
              )
              temp_dir = tempfile.mkdtemp(prefix=temp_dir.rstrip(".py"))
  
          # Make sure we have the correct path separators.
          temp_dir = temp_dir.replace("/", os.sep)
  
          def delete_temp_dir(dirname=temp_dir):
              try:
                  file_io.delete_recursively(dirname)
              except errors.OpError as e:
                  logging.error("Error removing %s: %s", dirname, e)
  
          atexit.register(delete_temp_dir)
  
          _googletest_temp_dir = temp_dir
  
      return _googletest_temp_dir
  
imports: import atexit
  import os
  import sys
  import tempfile
  from absl import app
  from absl.testing.absltest import *
  from tensorflow.python.framework import errors
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import tf_decorator
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 3 for calling a global function with example usage: GetTempDir() and returns: _googletest_temp_dir