# Path: pyston/filters/filters.py
# OPERATORS = Enum(
#     ('GT', 'gt'),
#     ('LT', 'lt'),
#     ('EQ', 'eq'),
#     ('NEQ', 'neq'),
#     ('LTE', 'lte'),
#     ('GTE', 'gte'),
#     ('CONTAINS', 'contains'),
#     ('ICONTAINS', 'icontains'),
#     ('RANGE', 'range'),
#     ('EXACT', 'exact'),
#     ('IEXACT', 'iexact'),
#     ('STARTSWITH', 'startswith'),
#     ('ISTARTSWITH', 'istartswith'),
#     ('ENDSWITH', 'endswith'),
#     ('IENDSWITH', 'iendswith'),
#     ('IN', 'in'),
#     ('RANGE', 'range'),
#     ('ALL', 'all'),
#     ('ISNULL', 'isnull'),
# )
# 
# Path: pyston/filters/utils.py
# LOGICAL_OPERATORS = Enum(
#     'AND',
#     'OR',
#     'NOT',
# )


import re
import pyparsing as pp
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext
from .filters import OPERATORS
from .utils import LOGICAL_OPERATORS
        '<=',
        '>',
        '<',
        '[a-z]+'
    )
    OPERATORS_MAPPING = {
        '=': OPERATORS.EQ,
        '!=': OPERATORS.NEQ,
        '<': OPERATORS.LT,
        '>': OPERATORS.GT,
        '>=': OPERATORS.GTE,
        '<=': OPERATORS.LTE,
    }
    VALUE_MAPPERS = {
        'null': None
    }
    DELIMITER = '__'

    def _clean_value(self, value):
        if isinstance(value, list):
            return [self._clean_value(v) for v in value]
        else:
            return self.VALUE_MAPPERS.get(value, value)

    def _clean_operator(self, operator_slug):
        return self.OPERATORS_MAPPING.get(operator_slug, operator_slug.lower())

    def _parse_to_conditions(self, parsed_result_list, condition_positions, condition, input):
        def _parse_to_conditions_recursive(term):
            if len(term) == 2 and term[0] == LOGICAL_OPERATORS.NOT:

# Path: pyston/filters/filters.py
# OPERATORS = Enum(
#     ('GT', 'gt'),
#     ('LT', 'lt'),
#     ('EQ', 'eq'),
#     ('NEQ', 'neq'),
#     ('LTE', 'lte'),
#     ('GTE', 'gte'),
#     ('CONTAINS', 'contains'),
#     ('ICONTAINS', 'icontains'),
#     ('RANGE', 'range'),
#     ('EXACT', 'exact'),
#     ('IEXACT', 'iexact'),
#     ('STARTSWITH', 'startswith'),
#     ('ISTARTSWITH', 'istartswith'),
#     ('ENDSWITH', 'endswith'),
#     ('IENDSWITH', 'iendswith'),
#     ('IN', 'in'),
#     ('RANGE', 'range'),
#     ('ALL', 'all'),
#     ('ISNULL', 'isnull'),
# )
# 
# Path: pyston/filters/utils.py
# LOGICAL_OPERATORS = Enum(
#     'AND',
#     'OR',
#     'NOT',
# )


# Path: pyston/filters/parser.py
import re
import pyparsing as pp
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext
from .filters import OPERATORS
from .utils import LOGICAL_OPERATORS

        '<=',
        '>',
        '<',
        '[a-z]+'
    )
    OPERATORS_MAPPING = {
        '=': OPERATORS.EQ,
        '!=': OPERATORS.NEQ,
        '<': OPERATORS.LT,
        '>': OPERATORS.GT,
        '>=': OPERATORS.GTE,
        '<=': OPERATORS.LTE,
    }
    VALUE_MAPPERS = {
        'null': None
    }
    DELIMITER = '__'

    def _clean_value(self, value):
        if isinstance(value, list):
            return [self._clean_value(v) for v in value]
        else:
            return self.VALUE_MAPPERS.get(value, value)

    def _clean_operator(self, operator_slug):
        return self.OPERATORS_MAPPING.get(operator_slug, operator_slug.lower())

    def _parse_to_conditions(self, parsed_result_list, condition_positions, condition, input):
        def _parse_to_conditions_recursive(term):
            if len(term) == 2 and term[0] == LOGICAL_OPERATORS.NOT:

                return ComposedCondition(LOGICAL_OPERATORS.NOT, _parse_to_conditions_recursive(term[1]))