Module Expr Str ImportFrom alias ImportFrom alias alias ImportFrom alias alias Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Num Assign NameStore Num Assign NameStore Num ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpAdd BinOpAdd Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore ListLoad While NameLoad body If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr body Assign NameStore ListLoad Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad Assign NameStore AttributeLoad NameLoad attr Continue orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad Break If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad Assign NameStore AttributeLoad NameLoad attr Continue orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad Break If BoolOpAnd CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body For NameStore Call AttributeLoad NameLoad attr body Expr Yield NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Yield NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore NameLoad If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If CompareLtE Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad orelse Assign NameStore Call NameLoad keyword NameLoad For NameStore AttributeLoad NameLoad attr body If BinOpMod Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num body Continue Assign NameStore Call NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore Call NameLoad keyword NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If BoolOpAnd Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr CompareEq AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str body Return Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad If BoolOpOr BoolOpAnd Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr CompareEq AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str BoolOpAnd CompareGt Call NameLoad AttributeLoad NameLoad attr Num Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Str CompareEq AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str body Return NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore NameLoad orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore NameLoad orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore NameLoad If BoolOpAnd Call NameLoad NameLoad Str CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameLoad If NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If BoolOpAnd Call NameLoad NameLoad Str CompareEq AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num orelse Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad keyword NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad keyword Call NameLoad NameLoad AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad keyword Call NameLoad NameLoad AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareIn NameLoad NameLoad body Assign NameStore Call NameLoad keyword SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body If CompareEq AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str body Assign NameStore NameLoad orelse If CompareEq AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str body Pass orelse Raise NameLoad Pass If BoolOpAnd NameLoad CompareIsNot NameLoad NameLoad body For NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Num body Assign NameStore Call NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Return NameLoad If CompareEq Call NameLoad NameLoad Num body Return SubscriptLoad NameLoad Index Num Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Str Str Str Str Str Assign NameStore ListLoad Assign NameStore Str For NameStore NameLoad body If Call NameLoad Call NameLoad NameLoad Lambda arguments args NameParam defaults CompareIs Call NameLoad NameLoad NameLoad body If Call NameLoad Call NameLoad NameLoad Lambda arguments args NameParam defaults BoolOpAnd Call NameLoad NameLoad NameLoad CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad Call NameLoad NameLoad Lambda arguments args NameParam defaults BoolOpAnd Call NameLoad NameLoad NameLoad CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore NameLoad orelse If NameLoad body Assign NameStore NameLoad orelse If NameLoad body Assign NameStore NameLoad Return Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore NameLoad body If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body For NameStore Call NameLoad NameLoad NameLoad body Expr Yield NameLoad orelse Expr Yield Call NameLoad NameLoad decorator_list
N/A N/A Utility functions used by the btm_matcher module N/A pytree pgen2 grammar token pygram pattern_symbols python_symbols N/A syms pattern_symbols N/A pysyms python_symbols N/A tokens N/A grammar opmap N/A token_labels token N/A TYPE_ANY -1 N/A TYPE_ALTERNATIVES -2 N/A TYPE_GROUP -3 MinNode N/A object N/A N/A This class serves as an intermediate representation of the
    pattern tree during the conversion to sets of leaf-to-root
    subpatterns __init__ N/A N/A self type name N/A None None N/A N/A N/A self type type N/A N/A self name name N/A N/A self children N/A N/A N/A self leaf False N/A N/A self parent None N/A N/A self alternatives N/A N/A N/A self group N/A N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A N/A str N/A self type N/A str N/A self name N/A leaf_to_root N/A N/A self N/A N/A N/A Internal method. Returns a characteristic path of the
        pattern tree. This method must be run for all leaves until the
        linear subpatterns are merged into a single N/A node self N/A subp N/A N/A node N/A N/A N/A N/A node type TYPE_ALTERNATIVES N/A N/A N/A N/A N/A node alternatives append subp N/A N/A N/A len N/A node alternatives N/A len N/A node children N/A N/A subp N/A N/A tuple N/A node alternatives N/A N/A node alternatives N/A N/A node N/A node parent N/A N/A N/A node N/A node parent N/A subp None N/A N/A N/A N/A node type TYPE_GROUP N/A N/A N/A N/A N/A node group append subp N/A N/A N/A len N/A node group N/A len N/A node children N/A N/A subp N/A get_characteristic_subpattern N/A node group N/A N/A node group N/A N/A node N/A node parent N/A N/A N/A node N/A node parent N/A subp None N/A N/A N/A N/A N/A node type N/A token_labels NAME N/A node name N/A N/A N/A N/A subp append N/A node name N/A N/A N/A N/A subp append N/A node type N/A node N/A node parent N/A subp N/A get_linear_subpattern N/A N/A self N/A N/A N/A Drives the leaf_to_root method. The reason that
        leaf_to_root must be run multiple times is because we need to
        reject 'group' matches; for example the alternative form
        (a | b c) creates a group [b c] that needs to be matched. Since
        matching multiple linear patterns overcomes the automaton's
        capabilities, leaf_to_root merges each group into a single
        choice based on 'characteristic'ity,

        i.e. (a|b c) -> (a|b) if b more characteristic than c

        Returns: The most 'characteristic'(as defined by
          get_characteristic_subpattern) path for the compiled pattern
          tree.
         N/A l N/A N/A self leaves N/A N/A subp N/A N/A l leaf_to_root N/A subp N/A N/A subp N/A leaves N/A N/A self N/A N/A N/A Generator that returns the leaves of the tree N/A child N/A self children N/A N/A x N/A N/A child leaves N/A N/A N/A x N/A N/A N/A self children N/A N/A N/A self N/A N/A reduce_tree N/A N/A node parent N/A None N/A N/A 
    Internal function. Reduces a compiled pattern tree to an
    intermediate representation suitable for feeding the
    automaton. This also trims off any optional pattern elements(like
    [a], a*).
     N/A new_node None N/A N/A N/A node type N/A syms Matcher N/A N/A node N/A N/A node children N/A 0 N/A N/A N/A node type N/A syms Alternatives N/A N/A N/A N/A len N/A node children 2 N/A N/A new_node N/A reduce_tree N/A N/A node children N/A 0 parent N/A N/A new_node N/A MinNode type TYPE_ALTERNATIVES N/A child N/A node children N/A N/A N/A N/A N/A N/A node children index child 2 N/A N/A N/A reduced N/A reduce_tree child new_node N/A N/A reduced None N/A N/A N/A N/A N/A new_node children append reduced N/A N/A N/A N/A node type N/A syms Alternative N/A N/A N/A N/A len N/A node children 1 N/A N/A new_node N/A MinNode type TYPE_GROUP N/A child N/A node children N/A N/A reduced N/A reduce_tree child new_node N/A reduced N/A N/A N/A N/A N/A new_node children append reduced N/A N/A N/A new_node children N/A N/A new_node None N/A N/A new_node N/A reduce_tree N/A N/A node children N/A 0 parent N/A N/A N/A N/A node type N/A syms Unit N/A N/A N/A N/A isinstance N/A N/A node children N/A 0 N/A pytree Leaf N/A N/A N/A N/A node children N/A 0 value ( N/A N/A N/A reduce_tree N/A N/A node children N/A 1 parent N/A N/A N/A N/A isinstance N/A N/A node children N/A 0 N/A pytree Leaf N/A N/A N/A N/A node children N/A 0 value [ N/A N/A N/A len N/A node children 1 N/A hasattr N/A N/A node children N/A 1 value N/A N/A N/A N/A node children N/A 1 value [ N/A N/A None N/A leaf True N/A details_node None N/A alternatives_node None N/A has_repeater False N/A repeater_node None N/A has_variable_name False N/A child N/A node children N/A N/A N/A N/A child type N/A syms Details N/A N/A leaf False N/A details_node child N/A N/A N/A N/A child type N/A syms Repeater N/A N/A has_repeater True N/A repeater_node child N/A N/A N/A N/A child type N/A syms Alternatives N/A N/A alternatives_node child N/A N/A N/A hasattr child value N/A N/A child value = N/A N/A has_variable_name True N/A has_variable_name N/A N/A name_leaf N/A N/A node children N/A 2 N/A N/A N/A hasattr name_leaf value N/A N/A name_leaf value ( N/A N/A name_leaf N/A N/A node children N/A 3 N/A N/A name_leaf N/A N/A node children N/A 0 N/A N/A N/A name_leaf type N/A token_labels NAME N/A N/A N/A N/A name_leaf value any N/A N/A new_node N/A MinNode type TYPE_ANY N/A N/A N/A hasattr token_labels N/A name_leaf value N/A N/A new_node N/A MinNode type N/A getattr token_labels N/A name_leaf value N/A N/A new_node N/A MinNode type N/A getattr pysyms N/A name_leaf value N/A N/A N/A N/A name_leaf type N/A token_labels STRING N/A N/A name N/A N/A N/A name_leaf value strip ' N/A N/A name tokens N/A N/A new_node N/A MinNode type N/A tokens N/A name N/A N/A new_node N/A MinNode type N/A token_labels NAME name name N/A N/A N/A N/A name_leaf type N/A syms Alternatives N/A N/A new_node N/A reduce_tree alternatives_node parent N/A has_repeater N/A N/A N/A N/A N/A N/A repeater_node children N/A 0 value * N/A N/A new_node None N/A N/A N/A N/A N/A N/A repeater_node children N/A 0 value + N/A N/A N/A N/A NotImplementedError N/A N/A N/A details_node N/A new_node None N/A N/A child N/A N/A details_node children N/A 1 -1 N/A N/A reduced N/A reduce_tree child new_node N/A N/A reduced None N/A N/A N/A N/A N/A new_node children append reduced N/A new_node N/A N/A N/A new_node parent parent N/A new_node N/A get_characteristic_subpattern N/A N/A subpatterns N/A N/A N/A Picks the most characteristic from a list of linear patterns
    Current order used is:
    names > common_names > common_chars
     N/A N/A N/A isinstance subpatterns list N/A N/A subpatterns N/A N/A N/A len subpatterns 1 N/A N/A N/A subpatterns N/A 0 N/A subpatterns_with_names N/A N/A subpatterns_with_common_names N/A N/A common_names N/A in for if not None N/A subpatterns_with_common_chars N/A N/A common_chars []().,: N/A subpattern subpatterns N/A N/A N/A any N/A rec_test subpattern N/A N/A N/A x N/A N/A N/A type x str N/A N/A N/A any N/A rec_test subpattern N/A N/A N/A x N/A N/A N/A isinstance x str N/A x common_chars N/A N/A N/A N/A subpatterns_with_common_chars append subpattern N/A N/A N/A any N/A rec_test subpattern N/A N/A N/A x N/A N/A N/A isinstance x str N/A x common_names N/A N/A N/A N/A subpatterns_with_common_names append subpattern N/A N/A N/A N/A subpatterns_with_names append subpattern N/A subpatterns_with_names N/A N/A subpatterns subpatterns_with_names N/A N/A subpatterns_with_common_names N/A N/A subpatterns subpatterns_with_common_names N/A N/A subpatterns_with_common_chars N/A N/A subpatterns subpatterns_with_common_chars N/A N/A max subpatterns key len N/A rec_test N/A N/A sequence test_func N/A N/A N/A Tests test_func on all items of sequence and items of included
    sub-iterables N/A x sequence N/A N/A N/A isinstance x N/A list tuple N/A N/A y N/A rec_test x test_func N/A N/A N/A y N/A N/A N/A N/A test_func x N/A