#NEWLINE# def _split_dict( self , d , splits ) : #NEWLINE# #INDENT# 'Split a dict by its keys.\n\n    splits: A list of lists of keys.\n    Returns one dict per split.\n    ' #NEWLINE# ret = [ ] #NEWLINE# for split in splits : #NEWLINE# #INDENT# dict_split = defaultdict ( list ) #NEWLINE# for f in split : #NEWLINE# #INDENT# if ( f in d ) : #NEWLINE# #INDENT# dict_split [ f ] = d [ f ] #NEWLINE# #UNINDENT# #UNINDENT# ret . append ( dict_split ) #NEWLINE# #UNINDENT# return ret