(fixer_list)
return dict(head_nodes)
Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.
Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.
Accepts a list of fixers and returns a dictionary of head node type -- > fixer list .
def _get_headnode_dict(fixer_list):
    """ Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.  """
    head_nodes = collections.defaultdict(list)
    every = []
    for fixer in fixer_list:
        if fixer.pattern:
            try:
                heads = _get_head_types(fixer.pattern)
            except _EveryNode:
                every.append(fixer)
            else:
                for node_type in heads:
                    head_nodes[node_type].append(fixer)
        else:
            if fixer._accept_type is not None:
                head_nodes[fixer._accept_type].append(fixer)
            else:
                every.append(fixer)
    for node_type in chain(pygram.python_grammar.symbol2number.values(),
                           pygram.python_grammar.tokens):
        head_nodes[node_type].extend(every)
    return dict(head_nodes)
def _get_headnode_dict ( fixer_list ) : head_nodes = collections . defaultdict ( list ) every = [ ] for fixer in fixer_list : if fixer . pattern : try : heads = _get_head_types ( fixer . pattern ) except _EveryNode : every . append ( fixer ) else : for node_type in heads : head_nodes [ node_type ] . append ( fixer ) else : if fixer . _accept_type is not None : head_nodes [ fixer . _accept_type ] . append ( fixer ) else : every . append ( fixer ) for node_type in chain ( pygram . python_grammar . symbol2number . values ( ) , pygram . python_grammar . tokens ) : head_nodes [ node_type ] . extend ( every ) return dict ( head_nodes )