<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter(cls, **kwargs):
 """ The meat. Filtering using Django model style syntax. All kwargs are translated into attributes on the underlying objects. If the attribute is not found, it looks for a similar key in the tags. There are a couple comparisons to check against as well: exact: check strict equality iexact: case insensitive exact like: check against regular expression ilike: case insensitive like contains: check if string is found with attribute icontains: case insensitive contains startswith: check if attribute value starts with the string istartswith: case insensitive startswith endswith: check if attribute value ends with the string iendswith: case insensitive startswith isnull: check if the attribute does not exist """

        qs = cls.all()
        for key in kwargs:
            qs = filter(lambda i: make_compare(key, kwargs[key], i), qs)
        return qs