Module Import alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str attr Str attr Str Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Return BinOpAdd Str NameLoad Return BinOpAdd Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad NameLoad Return SubscriptLoad Call NameLoad IfExp NameLoad NameLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr IfExp CompareEq Call NameLoad NameLoad Num Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Str For NameStore NameLoad body AugAssignAdd NameStore IfExp Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad TupleLoad TupleLoad body Expr Str Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore IfExp AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr NameLoad Str Assign NameStore IfExp AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Str Return Call AttributeLoad Str attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str If BoolOpAnd CompareEq Call NameLoad NameLoad Num Call NameLoad SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num orelse Assign NameStore Call NameLoad NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore Str Raise Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Call NameLoad NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad keyword Call NameLoad NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword NameLoad If BoolOpAnd CompareEq AttributeLoad NameLoad attr NameLoad CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad Call AttributeLoad Str attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad GeneratorExp CompareIs AttributeLoad NameLoad attr NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Call NameLoad BinOpAdd ListLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign NameStore Str Raise Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad Dict NameLoad Str attr AttributeLoad NameLoad attr Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body If NameLoad body If CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num body Assign NameStore IfExp AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad orelse Assign NameStore Call AttributeLoad Str attr NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr NameLoad orelse If CompareIn NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Slice Num Assign NameStore Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr Call NameLoad NameLoad keyword NameLoad Assign NameStore BoolOpOr AttributeLoad NameLoad attr Str Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Call NameLoad Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr comprehension NameStore NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list
N/A N/A itertools vendor.lexicon Lexicon argument Argument translate_underscores N/A N/A name N/A N/A N/A N/A N/A N/A N/A N/A N/A name lstrip _ rstrip _ replace _ - N/A to_flag N/A N/A name N/A N/A N/A name N/A translate_underscores name N/A N/A N/A len name 1 N/A N/A N/A - name N/A N/A -- name N/A sort_candidate N/A N/A arg N/A N/A N/A names N/A arg names N/A shorts N/A set N/A x N/A x names N/A N/A len N/A N/A x strip - 1 N/A longs N/A set N/A x N/A x names N/A x shorts N/A N/A N/A sorted N/A shorts shorts longs N/A 0 N/A flag_key N/A N/A x N/A N/A N/A 
    Obtain useful key list-of-ints for sorting CLI flags.
     N/A ret N/A N/A x N/A sort_candidate x N/A N/A N/A ret append N/A N/A N/A len x 1 1 0 N/A N/A N/A ret append N/A N/A x lower N/A inversed N/A char x N/A N/A inversed N/A N/A N/A char isupper N/A N/A char lower N/A N/A char upper N/A N/A N/A ret append inversed N/A ret N/A ParserContext N/A object N/A N/A 
    Parsing context with knowledge of flags & their format.

    Generally associated with the core program or a task.

    When run through a parser, will also hold runtime values filled in by the
    parser.
     __init__ N/A N/A self name aliases args N/A None N/A N/A N/A N/A 
        Create a new ``ParserContext`` named ``name``, with ``aliases``.

        ``name`` is optional, and should be a string if given. It's used to
        tell ParserContext objects apart, and for use in a Parser when
        determining what chunk of input might belong to a given ParserContext.

        ``aliases`` is also optional and should be an iterable containing
        strings. Parsing will honor any aliases when trying to "find" a given
        context in its input.

        May give one or more ``args``, which is a quick alternative to calling
        ``for arg in args: self.add_arg(arg)`` after initialization.
         N/A N/A self args N/A Lexicon N/A N/A self positional_args N/A N/A N/A self flags N/A Lexicon N/A N/A self inverse_flags N/A N/A N/A self name name N/A N/A self aliases aliases N/A arg args N/A N/A N/A N/A self add_arg arg N/A __str__ N/A N/A self N/A N/A N/A aliases N/A N/A self aliases N/A N/A aliases N/A N/A  ({0}) format N/A N/A ,  join N/A self aliases N/A name N/A N/A self name N/A N/A  {0!r}{1} format N/A self name aliases N/A args N/A N/A self args N/A N/A : {0!r} format N/A self args N/A N/A N/A <parser/Context{0}{1}> format name args N/A __repr__ N/A N/A self N/A N/A N/A N/A str self N/A add_arg N/A N/A self N/A args kwargs N/A N/A 
        Adds given ``Argument`` (or constructor args for one) to this context.

        The Argument in question is added to the following dict attributes:

        * ``args``: "normal" access, i.e. the given names are directly exposed
          as keys.
        * ``flags``: "flaglike" access, i.e. the given names are translated
          into CLI flags, e.g. ``"foo"`` is accessible via ``flags['--foo']``.
        * ``inverse_flags``: similar to ``flags`` but containing only the
          "inverse" versions of boolean flags which default to True. This
          allows the parser to track e.g. ``--no-myflag`` and turn it into a
          False value for the ``myflag`` Argument.
         N/A N/A N/A N/A len args 1 N/A isinstance N/A args N/A 0 Argument N/A N/A arg N/A args N/A 0 N/A N/A arg N/A Argument args kwargs N/A name N/A arg names N/A N/A N/A name N/A self args N/A N/A msg Tried to add an argument named {0!r} but one already exists! N/A N/A ValueError N/A N/A msg format name N/A main N/A N/A arg names N/A 0 N/A N/A N/A self args N/A main arg N/A N/A arg positional N/A N/A N/A N/A N/A self positional_args append arg N/A N/A N/A self flags N/A N/A to_flag main arg N/A name N/A arg nicknames N/A N/A N/A N/A N/A self args alias name to main N/A N/A N/A N/A self flags alias N/A to_flag name to N/A to_flag main N/A N/A arg attr_name N/A N/A N/A N/A N/A self args alias N/A arg attr_name to main N/A N/A N/A N/A arg kind bool N/A N/A arg default True N/A N/A inverse_name N/A to_flag N/A N/A no-{0} format main N/A N/A N/A self inverse_flags N/A inverse_name N/A to_flag main N/A needs_positional_arg N/A N/A self N/A N/A N/A N/A any N/A N/A N/A x value None N/A x N/A self positional_args N/A property as_kwargs N/A N/A self N/A N/A N/A 
        This context's arguments' values keyed by their ``.name`` attribute.

        Results in a dict suitable for use in Python contexts, where e.g. an
        arg named ``foo-bar`` becomes accessible as ``foo_bar``.
         N/A ret N/A N/A arg N/A N/A N/A self args values N/A N/A N/A ret N/A N/A arg name N/A arg value N/A ret N/A property names_for N/A N/A self flag N/A N/A N/A N/A list N/A set N/A N/A flag N/A N/A N/A self flags aliases_of flag N/A help_for N/A N/A self flag N/A N/A N/A 
        Return 2-tuple of ``(flag-spec, help-string)`` for given ``flag``.
         N/A N/A flag N/A self flags N/A N/A err {0!r} is not a valid flag for this context! Valid flags are: {1!r} N/A N/A ValueError N/A N/A err format flag N/A N/A N/A self flags keys N/A arg N/A N/A self flags N/A flag N/A value N/A N/A N/A str STRING get N/A arg kind N/A full_names N/A N/A name N/A N/A self names_for flag N/A N/A value N/A N/A N/A N/A len N/A N/A name strip - 1 N/A N/A value_ N/A N/A arg optional N/A N/A [{0}] format value value N/A valuestr N/A N/A  {0} format value_ N/A N/A valuestr N/A N/A ={0} format value N/A N/A arg optional N/A N/A valuestr N/A N/A [{0}] format valuestr N/A N/A N/A name N/A N/A N/A self inverse_flags values N/A N/A name N/A N/A --[no-]{0} format N/A name N/A 2 N/A valuestr N/A N/A N/A full_names append N/A name valuestr N/A namestr N/A N/A ,  join N/A sorted full_names key len N/A helpstr N/A N/A arg help N/A N/A namestr helpstr N/A help_tuples N/A N/A self N/A N/A N/A 
        Return sorted iterable of help tuples for all member Arguments.

        Sorts like so:

        * General sort is alphanumerically
        * Short flags win over long flags
        * Arguments with *only* long flags and *no* short flags will come
          first.
        * When an Argument has multiple long or short flags, it will sort using
          the most favorable (lowest alphabetically) candidate.

        This will result in a help list like so::

            --alpha, --zeta # 'alpha' wins
            --beta
            -a, --query # short flag wins
            -b, --argh
            -c
         N/A N/A list N/A map N/A N/A N/A x N/A N/A N/A self help_for N/A to_flag N/A x name N/A sorted N/A N/A N/A self flags values key flag_key N/A flag_names N/A N/A self N/A N/A N/A 
        Similar to `help_tuples` but returns flag names only, no helpstrs.

        Specifically, all flag names, flattened, in rough order.
         N/A flags N/A sorted N/A N/A N/A self flags values key flag_key N/A names N/A N/A N/A self names_for N/A to_flag N/A x name N/A x flags N/A N/A N/A names append N/A N/A N/A self inverse_flags keys N/A N/A tuple N/A N/A N/A itertools chain from_iterable names N/A N/A