#NEWLINE# def __dict_invert( self , data ) : #NEWLINE# #INDENT# 'Helper function for merge. \n\n        Takes a dictionary whose values are lists and returns a dict with \n        the elements of each list as keys and the original keys as values.\n        ' #NEWLINE# outdict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( k , lst ) in list ( data . items ( ) ) : #NEWLINE# #INDENT# if isinstance ( lst , str ) : #NEWLINE# #INDENT# lst = lst . split ( ) #NEWLINE# #UNINDENT# for entry in lst : #NEWLINE# #INDENT# outdict [ entry ] = k #NEWLINE# #UNINDENT# #UNINDENT# return outdict