def get_headnode_dict(fixer_list):
 head_nodes = defaultdict(list)
 for fixer in fixer_list:
  if (not fixer.pattern):
   head_nodes[None].append(fixer)
   continue
  for t in get_head_types(fixer.pattern):
   head_nodes[t].append(fixer)
 return head_nodes

def get_headnode_dict ( fixer_list ) : head_nodes = defaultdict ( list ) for fixer in fixer_list : if ( not fixer . pattern ) : head_nodes [ None ] . append ( fixer ) continue for t in get_head_types ( fixer . pattern ) : head_nodes [ t ] . append ( fixer ) return head_nodes
accepts a list of fixers and returns a dictionary of head node type --> fixer list .