code: def parse_args():
      parser = argparse.ArgumentParser(
          description="Bluefog Interactive Python Runner"
      )
  
      parser.add_argument(
          "-v",
          "--version",
          action="store_true",
          dest="version",
          help="Shows bluefog version.",
      )
  
      subparsers = parser.add_subparsers(
          dest="action",
          help="Start or stop interactive Bluefog cluster. "
          "You usually do not need to stop the cluster explicitly.",
      )
      parser_start = subparsers.add_parser(
          "start", help="Start the interactive Bluefog cluster"
      )
      parser_stop = subparsers.add_parser(
          "stop", help="Stop the interactive Bluefog cluster"
      )
  
      parser_start.add_argument(
          "-np",
          "--num-proc",
          action="store",
          dest="np",
          required=True,
          type=int,
          help="Total number of training processes.",
      )
  
      parser_start.add_argument(
          "-p",
          "--ssh-port",
          action="store",
          dest="ssh_port",
          type=int,
          help="SSH port on all the hosts.",
      )
  
      parser_start.add_argument(
          "--network-interface",
          action="store",
          dest="nic",
          help="Specify the network interface used for communication.",
      )
  
      parser_start.add_argument(
          "--use-infiniband",
          action="store_true",
          dest="use_infiniband",
          help="If set, use inifiniband to communication instead of TCP.",
      )
  
      parser_start.add_argument(
          "--ipython-profile",
          action="store",
          dest="profile",
          type=str,
          default="bluefog",
          help="The profile name for ipython environment.",
      )
  
      parser_start.add_argument(
          "--enable-heartbeat",
          action="store_true",
          dest="enable_heartbeat",
          help="Enable the heartbeat checking service between "
          "ipcontroller and ipengines.",
      )
  
      group_hosts_parent = parser_start.add_argument_group(
          "host arguments"
      )
      group_hosts = group_hosts_parent.add_mutually_exclusive_group()
      group_hosts.add_argument(
          "-H",
          "--hosts",
          action="store",
          dest="hosts",
          help="List of host names and the number of available slots "
          "for running processes on each, of the form: <hostname>:<slots> "
          "(e.g.: host1:2,host2:4,host3:1 indicating 2 processes can run "
          "on host1, 4 on host2, and 1 on host3). If not specified, "
          "defaults to using localhost:<np>",
      )
      group_hosts.add_argument(
          "-hostfile",
          "--hostfile",
          action="store",
          dest="hostfile",
          help="Path to a host file containing the list of host names and "
          "the number of available slots. Each line of the file must be "
          "of the form: <hostname> slots=<slots>",
      )
  
      parser_start.add_argument(
          "--verbose",
          action="store_true",
          dest="verbose",
          help="If this flag is set, extra messages will printed.",
      )
  
      parser_start.add_argument(
          "--extra-mpi-flags",
          action="store",
          dest="extra_flags",
          help="Extra mpi flages you want to pass for mpirun.",
      )
  
      parser_stop.add_argument(
          "--ipython-profile",
          action="store",
          dest="profile",
          type=str,
          default="bluefog",
          help="The profile name for ipython environment.",
      )
  
      parsed_args = parser.parse_args()
      return parsed_args
  
imports: import argparse
  import json
  import os
  import multiprocessing
  import signal
  import subprocess
  import time
  from typing import Dict, List
  import ipyparallel
  import bluefog
  from bluefog.run import env_util, network_util, horovod_driver
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args() and returns: parsed_args