def operator(op):
    """
    Returns a function which performs comparision operations
    """
    if op == '==':
        return lambda x, y: x == y
    if op == '!=':
        return lambda x, y: x != y
    if op == '<=':
        return lambda x, y: x <= y
    if op == '>=':
        return lambda x, y: x >= y
    if op == '<':
        return lambda x, y: x < y
    if op == '>':
        return lambda x, y: x > y
    raise Exception('operator %s not found' % op)
