code: def GetTestExecutablePath(executable_name, build_dir=None):
      """Returns the absolute path of the test binary given its name.
  
      The function will print a message and abort the program if the resulting file
      doesn't exist.
  
      Args:
        executable_name: name of the test binary that the test script runs.
        build_dir:       directory where to look for executables, by default the
          result of GetBuildDir().
  
      Returns:
        The absolute path of the test binary.
      """
  
      path = os.path.abspath(
          os.path.join(build_dir or GetBuildDir(), executable_name)
      )
      if (IS_WINDOWS or IS_CYGWIN or IS_OS2) and not path.endswith(
          ".exe"
      ):
          path += ".exe"
  
      if not os.path.exists(path):
          message = (
              'Unable to find the test binary "%s". Please make sure to provide\n'
              "a path to the binary via the --build_dir flag or the BUILD_DIR\n"
              "environment variable." % path
          )
          print(message, file=sys.stderr)
          sys.exit(1)
  
      return path
  
file_path: googletest/googletest/test/gtest_test_utils.py
imports: import os
  import subprocess
  import sys
  import atexit
  import shutil
  import tempfile
  import unittest
label_desc: Use image node_id 8 for calling a global function with example usage: GetTestExecutablePath(executable_name, build_dir) and returns: path