def init_argument_parser(name=None, **kwargs):
    """Creates a global ArgumentParser instance with the given name,
    passing any args other than "name" to the ArgumentParser constructor.
    This instance can then be retrieved using get_argument_parser(..)
    """

    if name is None:
        name = "default"

    if name in _parsers:
        raise ValueError(("kwargs besides 'name' can only be passed in the"
            " first time. '%s' ArgumentParser already exists: %s") % (
            name, _parsers[name]))

    kwargs.setdefault('formatter_class', argparse.ArgumentDefaultsHelpFormatter)
    kwargs.setdefault('conflict_handler', 'resolve')
    _parsers[name] = ArgumentParser(**kwargs)
def init_argument_parser ( name = None , ** kwargs ) : if name is None : name = "default" if name in _parsers : raise ValueError ( ( "kwargs besides 'name' can only be passed in the" " first time. '%s' ArgumentParser already exists: %s" ) % ( name , _parsers [ name ] ) ) kwargs . setdefault ( 'formatter_class' , argparse . ArgumentDefaultsHelpFormatter ) kwargs . setdefault ( 'conflict_handler' , 'resolve' ) _parsers [ name ] = ArgumentParser ( ** kwargs )
Creates a global ArgumentParser instance with the given name,
    passing any args other than "name" to the ArgumentParser constructor.
    This instance can then be retrieved using get_argument_parser(..)