def reverse_operator(op):
    """adjusted operators for reversed lhs and rhs"""
    if op == '<':
        rev = '>'
    elif op == '<=':
        rev = '>='
    elif op == '>':
        rev = '<'
    elif op == '>=':
        rev = '<='
    elif op in {'==', '!=', '&', '|', 'in'}:
        rev = op
    else:
        raise Exception(u'operator not implemented')
    return rev
