code: def run_path(path_name, init_globals=None, run_name=None):
      """Execute code located at the specified filesystem location.
  
      path_name -- filesystem location of a Python script, zipfile,
      or directory containing a top level __main__.py script.
  
      Optional arguments:
      init_globals -- dictionary used to pre-populate the module’s
      globals dictionary before the code is executed.
  
      run_name -- if not None, this will be used to set __name__;
      otherwise, '<run_path>' will be used for __name__.
  
      Returns the resulting module globals dictionary.
      """
      if run_name is None:
          run_name = "<run_path>"
      pkg_name = run_name.rpartition(".")[0]
      from pkgutil import get_importer
  
      importer = get_importer(path_name)
      # Trying to avoid importing imp so as to not consume the deprecation warning.
      is_NullImporter = False
      if type(importer).__module__ == "imp":
          if type(importer).__name__ == "NullImporter":
              is_NullImporter = True
      if isinstance(importer, type(None)) or is_NullImporter:
          # Not a valid sys.path entry, so run the code directly
          # execfile() doesn't help as we want to allow compiled files
          code, fname = _get_code_from_file(run_name, path_name)
          return _run_module_code(
              code,
              init_globals,
              run_name,
              pkg_name=pkg_name,
              script_name=fname,
          )
      else:
          # Finder is defined for path, so add it to
          # the start of sys.path
          sys.path.insert(0, path_name)
          try:
              # Here's where things are a little different from the run_module
              # case. There, we only had to replace the module in sys while the
              # code was running and doing so was somewhat optional. Here, we
              # have no choice and we have to remove it even while we read the
              # code. If we don't do this, a __loader__ attribute in the
              # existing __main__ module may prevent location of the new module.
              mod_name, mod_spec, code = _get_main_module_details()
              with _TempModule(run_name) as temp_module, _ModifiedArgv0(
                  path_name
              ):
                  mod_globals = temp_module.module.__dict__
                  return _run_code(
                      code,
                      mod_globals,
                      init_globals,
                      run_name,
                      mod_spec,
                      pkg_name,
                  ).copy()
          finally:
              try:
                  sys.path.remove(path_name)
              except ValueError:
                  pass
  
imports: import sys
  import importlib.machinery
  import importlib.util
  import io
  import os
label_desc: Use image node_id 8 for calling a global function with example usage: run_path(path_name, init_globals, run_name) and returns: _run_module_code, _run_code