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