def parse_query_value(combined_value):
    """Parse value in form of '>value' to a lambda and a value."""
    split = len(combined_value) - len(combined_value.lstrip('<>='))
    operator = combined_value[:split]
    if operator == '':
        operator = '='
    try:
        operator_func = search_operators[operator]
    except KeyError:
        raise ValueError(
            'Numeric query should start with operator, choose from %s' %
            ', '.join(search_operators.keys()))
    value = combined_value[split:].strip()
    return operator_func, value
def parse_query_value ( combined_value ) : split = len ( combined_value ) - len ( combined_value . lstrip ( '<>=' ) ) operator = combined_value [ : split ] if operator == '' : operator = '=' try : operator_func = search_operators [ operator ] except KeyError : raise ValueError ( 'Numeric query should start with operator, choose from %s' % ', ' . join ( search_operators . keys ( ) ) ) value = combined_value [ split : ] . strip ( ) return operator_func , value
Parse value in form of '>value' to a lambda and a value.