code: def parse_args():
      override_args = set()
  
      parser = argparse.ArgumentParser(description="Bluefog Runner")
  
      parser.add_argument(
          "-v",
          "--version",
          action="store_true",
          dest="version",
          help="Shows bluefog version.",
      )
  
      parser.add_argument(
          "-np",
          "--num-proc",
          action="store",
          dest="np",
          type=int,
          help="Total number of training processes.",
      )
  
      parser.add_argument(
          "-p",
          "--ssh-port",
          action="store",
          dest="ssh_port",
          type=int,
          help="SSH port on all the hosts.",
      )
  
      parser.add_argument(
          "--network-interface",
          action="store",
          dest="nic",
          help="Specify the network interface used for communication.",
      )
  
      group_hosts_parent = parser.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.add_argument(
          "--use-infiniband",
          action="store_true",
          dest="use_infiniband",
          help="If set, use inifiniband to communication instead of TCP.",
      )
  
      parser.add_argument(
          "--extra-mpi-flags",
          action="store",
          dest="extra_flags",
          help="Extra mpi flages you want to pass for mpirun.",
      )
  
      parser.add_argument(
          "--prefix",
          action="store",
          dest="prefix",
          default="",
          type=str,
          help="A prefix path to add before mpirun. "
          "Set if you need to specify the path for mpirun",
      )
  
      parser.add_argument(
          "--verbose",
          action="store_true",
          dest="verbose",
          help="If this flag is set, extra messages will " "printed.",
      )
  
      parser.add_argument(
          "command",
          nargs=argparse.REMAINDER,
          help="Command to be executed.",
      )
  
      group_timeline = parser.add_argument_group("timeline arguments")
      group_timeline.add_argument(
          "--timeline-filename",
          action=make_override_action(override_args),
          help="JSON file containing timeline of "
          "Bluefog events used for debugging "
          "performance. If this is provided, "
          "timeline events will be recorded, "
          "which can have a negative impact on training performance.",
      )
  
      parsed_args = parser.parse_args()
  
      if not parsed_args.version and not parsed_args.np:
          parser.error("argument -np/--num-proc is required")
  
      return parsed_args
  
file_path: bluefog/bluefog/run/run.py
imports: import argparse
  import os
  import re
  import shlex
  import socket
  import subprocess
  import sys
  import traceback
  import psutil
  import bluefog
  from bluefog.run import env_util, network_util, horovod_driver
label_desc: Use image node_id 2 for calling a global function with example usage: parse_args() and returns: parsed_args