parameters: ()
return_statement: return parser
docstring: Creates and returns the main parser for pip's CLI
docstring_summary: Creates and returns the main parser for pip's CLI
docstring_tokens: Creates and returns the main parser for pip s CLI
function: def create_main_parser():
      # type: () -> ConfigOptionParser
      """Creates and returns the main parser for pip's CLI
      """
  
      parser_kw = {
          'usage': '\n%prog <command> [options]',
          'add_help_option': False,
          'formatter': UpdatingDefaultsHelpFormatter(),
          'name': 'global',
          'prog': get_prog(),
      }
  
      parser = ConfigOptionParser(**parser_kw)
      parser.disable_interspersed_args()
  
      parser.version = get_pip_version()
  
      # add the general options
      gen_opts = cmdoptions.make_option_group(cmdoptions.general_group, parser)
      parser.add_option_group(gen_opts)
  
      # so the help formatter knows
      parser.main = True  # type: ignore
  
      # create command listing for description
      description = [''] + [
          '{name:27} {command_info.summary}'.format(**locals())
          for name, command_info in commands_dict.items()
      ]
      parser.description = '\n'.join(description)
  
      return parser
function_tokens: def create_main_parser ( ) : # type: () -> ConfigOptionParser parser_kw = { 'usage' : '\n%prog <command> [options]' , 'add_help_option' : False , 'formatter' : UpdatingDefaultsHelpFormatter ( ) , 'name' : 'global' , 'prog' : get_prog ( ) , } parser = ConfigOptionParser ( * * parser_kw ) parser . disable_interspersed_args ( ) parser . version = get_pip_version ( ) # add the general options gen_opts = cmdoptions . make_option_group ( cmdoptions . general_group , parser ) parser . add_option_group ( gen_opts ) # so the help formatter knows parser . main = True # type: ignore # create command listing for description description = [ '' ] + [ '{name:27} {command_info.summary}' . format ( * * locals ( ) ) for name , command_info in commands_dict . items ( ) ] parser . description = '\n' . join ( description ) return parser