code: def main():
      """Entry-point for ``python -m mpi4py.run ...``."""
      # pylint: disable=too-many-statements
      # pylint: disable=import-outside-toplevel
      import os
      import sys
  
      def prefix():
          prefix = os.path.dirname(__spec__.origin)
          print(prefix, file=sys.stdout)
          sys.exit(0)
  
      def version():
          from . import __version__
  
          package = __spec__.parent
          print(f"{package} {__version__}", file=sys.stdout)
          sys.exit(0)
  
      def mpi_std_version():
          from . import rc
  
          rc.initialize = rc.finalize = False
          from . import MPI
  
          version = ".".join(map(str, (MPI.VERSION, MPI.SUBVERSION)))
          rtversion = ".".join(map(str, MPI.Get_version()))
          note = (
              f" (runtime: MPI {rtversion})"
              if rtversion != version
              else ""
          )
          print(f"MPI {version}{note}", file=sys.stdout)
          sys.exit(0)
  
      def mpi_lib_version():
          from . import rc
  
          rc.initialize = rc.finalize = False
          from . import MPI
  
          library_version = MPI.Get_library_version()
          print(library_version, file=sys.stdout)
          sys.exit(0)
  
      def usage(errmess=None):
          from textwrap import dedent
  
          python = os.path.basename(sys.executable)
          program = __spec__.name
  
          cmdline = dedent(
              f"""
          usage: {python} -m {program} [options] <pyfile> [arg] ...
             or: {python} -m {program} [options] -m <mod> [arg] ...
             or: {python} -m {program} [options] -c <cmd> [arg] ...
             or: {python} -m {program} [options] - [arg] ...
          """
          ).strip()
  
          helptip = dedent(
              f"""
          Try `{python} -m {program} -h` for more information.
          """
          ).strip()
  
          options = dedent(
              """
          options:
            --prefix             show install path and exit
            --version            show version number and exit
            --mpi-std-version    show MPI standard version and exit
            --mpi-lib-version    show MPI library version and exit
            -h|--help            show this help message and exit
            -rc <key=value,...>  set 'mpi4py.rc.key=value'
          """
          ).strip()
  
          if errmess:
              print(errmess, file=sys.stderr)
              print(cmdline, file=sys.stderr)
              print(helptip, file=sys.stderr)
              sys.exit(1)
          else:
              print(cmdline, file=sys.stdout)
              print(options, file=sys.stdout)
              sys.exit(0)
  
      def parse_command_line(args=None):
          # pylint: disable=too-many-branches
  
          class Options:
              # pylint: disable=too-few-public-methods
              # pylint: disable=missing-class-docstring
              rc_args = {}
  
          def poparg(args):
              if len(args) < 2 or args[1].startswith("-"):
                  usage("Argument expected for option: " + args[0])
              return args.pop(1)
  
          options = Options()
          args = sys.argv[1:] if args is None else args[:]
          while args and args[0].startswith("-"):
              if args[0] in ("-m", "-c", "-"):
                  break  # Stop processing options
              if args[0] in ("-h", "-help", "--help"):
                  usage()  # Print help and exit
              if args[0] in ("-prefix", "--prefix"):
                  prefix()  # Print install path and exit
              if args[0] in ("-version", "--version"):
                  version()  # Print version number and exit
              if args[0] in ("-mpi-std-version", "--mpi-std-version"):
                  mpi_std_version()  # Print MPI standard version and exit
              if args[0] in ("-mpi-lib-version", "--mpi-lib-version"):
                  mpi_lib_version()  # Print MPI library version and exit
              try:
                  arg0 = args[0]
                  if arg0.startswith("--"):
                      if "=" in arg0:
                          opt, _, arg = arg0[1:].partition("=")
                          if opt in ("-rc",):
                              arg0, args[1:1] = opt, [arg]
                      else:
                          arg0 = arg0[1:]
                  if arg0 == "-rc":
                      from ast import literal_eval
  
                      for entry in poparg(args).split(","):
                          key, _, val = entry.partition("=")
                          if not key or not val:
                              raise ValueError(entry)
                          try:
                              val = literal_eval(val)
                          except ValueError:
                              pass
                          options.rc_args[key] = val
                  else:
                      usage("Unknown option: " + args[0])
                  del args[0]
              except Exception:  # pylint: disable=broad-except
                  # Bad option, print usage and exit with error
                  usage("Cannot parse option: " + args[0])
          # Check remaining args and return to caller
          if not args:
              usage("No path specified for execution")
          elif args[0] in ("-m", "-c") and len(args) < 2:
              usage("Argument expected for option: " + args[0])
          return options, args
  
      def bootstrap(options):
          if options.rc_args:  # Set mpi4py.rc parameters
              from . import rc
  
              rc(**options.rc_args)
  
      # Parse and process command line options
      options, args = parse_command_line()
      bootstrap(options)
  
      # Run user code. In case of an unhandled exception, abort
      # execution of the MPI program by calling 'MPI_Abort()'.
      try:
          run_command_line(args)
      except SystemExit as exc:
          set_abort_status(exc)
          raise
      except KeyboardInterrupt as exc:
          set_abort_status(exc)
          raise
      except BaseException:
          set_abort_status(1)
          raise
  
label_desc: Use image node_id 3 for calling a global function with example usage: main() and returns: options,  args, args