original_docstring: 
      Creates the argparse parser with all the arguments.
      
docstring: Creates the argparse parser with all the arguments.
docstring_tokens: Creates the argparse parser with all the arguments .
code: def create_parser():
      """
      Creates the argparse parser with all the arguments.
      """
      parser = argparse.ArgumentParser(
          description='Management CLI for policydb',
          formatter_class=argparse.ArgumentDefaultsHelpFormatter,
      )
  
      # Add subcommands
      subparsers = parser.add_subparsers(title='subcommands', dest='cmd')
      parser_add = subparsers.add_parser('add_rule', help='Add rule')
      parser_add.add_argument('rule_id', help='rule id to add')
      parser_add.add_argument('-ipd', '--ipv4_dst', help='ipv4 dst for rule')
      parser_add.add_argument('-ips', '--ipv4_src', help='ipv4 src for rule')
      parser_add.add_argument(
          '-p', '--ip_proto', help='ip proto for rule',
          type=int,
      )
      parser_add.add_argument(
          '-td', '--tcp_dst', type=int,
          help='tcp dst for rule, set -p to IPPROTO_TCP(6)',
      )
      parser_add.add_argument(
          '-ts', '--tcp_src', type=int,
          help='tcp src for rule, set -p to IPPROTO_TCP(6)',
      )
      parser_add.add_argument(
          '-ud', '--udp_dst', type=int,
          help='udp dst for rule, set -p to IPPROTO_UDP(17)',
      )
      parser_add.add_argument(
          '-us', '--udp_src', type=int,
          help='udp src for rule, set -p to IPPROTO_UDP(17)',
      )
      parser_add.add_argument(
          '-d', '--direction', type=int,
          help='0 == UPLINK, 1 == DOWNLINK',
      )
      parser_add.add_argument(
          '-a', '--action', type=int,
          help='0 == PERMIT, 1 == DENY',
      )
      parser_add.add_argument(
          '-o', '--overwrite', action='store_true',
          help='overwrite existing rule',
      )
  
      parser_install = subparsers.add_parser(
          'install_rules', help='Install static rules for a subscriber',
      )
      parser_install.add_argument('-id', help='session id')
      parser_install.add_argument('-imsi', help='subscriber IMSI')
      parser_install.add_argument(
          '-rules', nargs='*',
          help='static rules to install',
      )
      parser_install.add_argument(
          '-basenames', nargs='*',
          help='basenames to install',
      )
  
      parser_uninstall = subparsers.add_parser(
          'uninstall_rules', help='Uninstall static rules for a subscriber',
      )
      parser_uninstall.add_argument('-id', help='session id')
      parser_uninstall.add_argument('-imsi', help='subscriber IMSI')
      parser_uninstall.add_argument(
          '-rules', nargs='*',
          help='static rules to uninstall',
      )
      parser_uninstall.add_argument(
          '-basenames', nargs='*',
          help='basenames to install',
      )
  
      parser_dump = subparsers.add_parser(
          'dump_data', help='Dumps all Redis data maintained by policydb',
      )
  
      # Add function callbacks
      parser_add.set_defaults(func=add_rule)
      parser_install.set_defaults(func=install_rules)
      parser_uninstall.set_defaults(func=uninstall_rules)
      parser_dump.set_defaults(func=dump_data)
  
      return parser
code_tokens: def create_parser ( ) : parser = argparse . ArgumentParser ( description = 'Management CLI for policydb' , formatter_class = argparse . ArgumentDefaultsHelpFormatter , ) subparsers = parser . add_subparsers ( title = 'subcommands' , dest = 'cmd' ) parser_add = subparsers . add_parser ( 'add_rule' , help = 'Add rule' ) parser_add . add_argument ( 'rule_id' , help = 'rule id to add' ) parser_add . add_argument ( '-ipd' , '--ipv4_dst' , help = 'ipv4 dst for rule' ) parser_add . add_argument ( '-ips' , '--ipv4_src' , help = 'ipv4 src for rule' ) parser_add . add_argument ( '-p' , '--ip_proto' , help = 'ip proto for rule' , type = int , ) parser_add . add_argument ( '-td' , '--tcp_dst' , type = int , help = 'tcp dst for rule, set -p to IPPROTO_TCP(6)' , ) parser_add . add_argument ( '-ts' , '--tcp_src' , type = int , help = 'tcp src for rule, set -p to IPPROTO_TCP(6)' , ) parser_add . add_argument ( '-ud' , '--udp_dst' , type = int , help = 'udp dst for rule, set -p to IPPROTO_UDP(17)' , ) parser_add . add_argument ( '-us' , '--udp_src' , type = int , help = 'udp src for rule, set -p to IPPROTO_UDP(17)' , ) parser_add . add_argument ( '-d' , '--direction' , type = int , help = '0 == UPLINK, 1 == DOWNLINK' , ) parser_add . add_argument ( '-a' , '--action' , type = int , help = '0 == PERMIT, 1 == DENY' , ) parser_add . add_argument ( '-o' , '--overwrite' , action = 'store_true' , help = 'overwrite existing rule' , ) parser_install = subparsers . add_parser ( 'install_rules' , help = 'Install static rules for a subscriber' , ) parser_install . add_argument ( '-id' , help = 'session id' ) parser_install . add_argument ( '-imsi' , help = 'subscriber IMSI' ) parser_install . add_argument ( '-rules' , nargs = '*' , help = 'static rules to install' , ) parser_install . add_argument ( '-basenames' , nargs = '*' , help = 'basenames to install' , ) parser_uninstall = subparsers . add_parser ( 'uninstall_rules' , help = 'Uninstall static rules for a subscriber' , ) parser_uninstall . add_argument ( '-id' , help = 'session id' ) parser_uninstall . add_argument ( '-imsi' , help = 'subscriber IMSI' ) parser_uninstall . add_argument ( '-rules' , nargs = '*' , help = 'static rules to uninstall' , ) parser_uninstall . add_argument ( '-basenames' , nargs = '*' , help = 'basenames to install' , ) parser_dump = subparsers . add_parser ( 'dump_data' , help = 'Dumps all Redis data maintained by policydb' , ) parser_add . set_defaults ( func = add_rule ) parser_install . set_defaults ( func = install_rules ) parser_uninstall . set_defaults ( func = uninstall_rules ) parser_dump . set_defaults ( func = dump_data ) return parser
short_docstring: Creates the argparse parser with all the arguments.
short_docstring_tokens: Creates the argparse parser with all the arguments .
comment: """
      Creates the argparse parser with all the arguments.
      """$SEP$# Add subcommands$SEP$# Add function callbacks