code: def filter_formatter(kwargs, attr_map):
      
      params = _depluralise_filters_key(copy.copy(kwargs))
      params.update(_get_filter(sdk_filter=params.pop('filter', {}), attr_map=attr_map))
      return params
docs: Builds a filter according to the cross-api specification
  
      :param kwargs: expected to contain {'filter': {filter dict}}
      :returns: {validated filter dict}