@classmethod<EOL><INDENT>def _process_filters(cls, filters):<DEDENT>
data = []<EOL>for f in filters:<EOL><INDENT>if isinstance(f, Filter):<EOL><INDENT>if f.filters:<EOL><INDENT>data.extend(cls._process_filters(f.filters))<EOL><DEDENT><DEDENT>elif isinstance(f, dict):<EOL><INDENT>key = list(f.keys())[<NUM_LIT:0>]<EOL>val = f[key]<EOL>if isinstance(val, dict):<EOL><INDENT>filter_filters = cls._process_filters([val])<EOL>if len(filter_filters) == <NUM_LIT:1>:<EOL><INDENT>filter_filters = filter_filters[<NUM_LIT:0>]<EOL><DEDENT>data.append({key: filter_filters})<EOL><DEDENT>else:<EOL><INDENT>data.append({key: cls._process_filters(val)})<EOL><DEDENT><DEDENT>else:<EOL><INDENT>data.extend((f,))<EOL><DEDENT><DEDENT>return data<EOL>
Takes a list of filters and returns JSON

        :Parameters:
        - `filters`: List of Filters, (key, val) tuples, or dicts

        Returns: List of JSON API filters