code: def _get_main_module_details(error=ImportError):
      # Helper that gives a nicer error message when attempting to
      # execute a zipfile or directory by invoking __main__.py
      # Also moves the standard __main__ out of the way so that the
      # preexisting __loader__ entry doesn't cause issues
      main_name = "__main__"
      saved_main = sys.modules[main_name]
      del sys.modules[main_name]
      try:
          return _get_module_details(main_name)
      except ImportError as exc:
          if main_name in str(exc):
              raise error(
                  "can't find %r module in %r"
                  % (main_name, sys.path[0])
              ) from exc
          raise
      finally:
          sys.modules[main_name] = saved_main
  
imports: import sys
  import importlib.machinery
  import importlib.util
  import io
  import os
label_desc: Use image node_id 6 for calling a global function with example usage: _get_main_module_details(error) and returns: _get_module_details