code: def _run_module_as_main(mod_name, alter_argv=True):
      """Runs the designated module in the __main__ namespace
  
      Note that the executed module will have full access to the
      __main__ namespace. If this is not desirable, the run_module()
      function should be used to run the module code in a fresh namespace.
  
      At the very least, these variables in __main__ will be overwritten:
          __name__
          __file__
          __cached__
          __loader__
          __package__
      """
      try:
          if alter_argv or mod_name != "__main__":  # i.e. -m switch
              mod_name, mod_spec, code = _get_module_details(
                  mod_name, _Error
              )
          else:  # i.e. directory or zipfile execution
              mod_name, mod_spec, code = _get_main_module_details(
                  _Error
              )
      except _Error as exc:
          msg = "%s: %s" % (sys.executable, exc)
          sys.exit(msg)
      main_globals = sys.modules["__main__"].__dict__
      if alter_argv:
          sys.argv[0] = mod_spec.origin
      return _run_code(code, main_globals, None, "__main__", mod_spec)
  
imports: import sys
  import importlib.machinery
  import importlib.util
  import io
  import os
label_desc: Use image node_id 4 for calling a global function with example usage: _run_module_as_main(mod_name, alter_argv) and returns: _run_code