#NEWLINE# def _filter_dict( input_dict , search_key , search_value ) : #NEWLINE# #INDENT# '\n    Filters a dictionary of dictionaries by a key-value pair.\n\n    :param input_dict:    is a dictionary whose values are lists of dictionaries\n    :param search_key:    is the key in the leaf dictionaries\n    :param search_values: is the value in the leaf dictionaries\n    :return:              filtered dictionary\n    ' #NEWLINE# output_dict = dict ( ) #NEWLINE# for ( key , key_list ) in six . iteritems ( input_dict ) : #NEWLINE# #INDENT# key_list_filtered = _filter_list ( key_list , search_key , search_value ) #NEWLINE# if key_list_filtered : #NEWLINE# #INDENT# output_dict [ output_dict ] = key_list_filtered #NEWLINE# #UNINDENT# #UNINDENT# return output_dict