def filter_formatter(kwargs, attr_map):
    """Builds a filter according to the cross-api specification

    :param kwargs: expected to contain {'filter': {filter dict}}
    :returns: {validated filter dict}
    """
    params = _depluralise_filters_key(copy.copy(kwargs))
    params.update(_get_filter(sdk_filter=params.pop('filter', {}), attr_map=attr_map))
    return params
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
Builds a filter according to the cross-api specification

    :param kwargs: expected to contain {'filter': {filter dict}}
    :returns: {validated filter dict}