Filters :data for the objects in it which possess attributes equal in
    name/value to a key/value in kwargs.

    Each key/value combination in kwargs is compared against the object, so
    multiple keyword arguments can be passed in to constrain the filtering.

def assembla_filter(func):
    """
    Filters :data for the objects in it which possess attributes equal in
    name/value to a key/value in kwargs.

    Each key/value combination in kwargs is compared against the object, so
    multiple keyword arguments can be passed in to constrain the filtering.
    """
    @wraps(func)
    def wrapper(class_instance, **kwargs):

        # Get the result
        extra_params = kwargs.get('extra_params', None)
        if extra_params:
            del kwargs['extra_params']
        results = func(class_instance, extra_params)

        # Filter the result
        if kwargs:
            results = filter(
                # Find the objects who have an equal number of matching attr/value
                # combinations as `len(kwargs)`
                lambda obj: len(kwargs) == len(
                    filter(
                        lambda boolean: boolean,
                        [obj.get(attr_name) == value
                            for attr_name, value in kwargs.iteritems()]
                    )
                ),
                results
            )

        return results
    return wrapper