def rulesorter(a, b):
    """Compares two rules for sorting, sorting simple lookups before ones
    which require additional hits to the reddit api"""
    order = ['type','body','bodylength','dayhour','domain','downvotes',
            'numreports','score','title','upvotes','url','username',
            'userkarma','userage']
    a = a[0].replace('!', '').lower()
    b = b[0].replace('!', '').lower()
    if a in order and b in order:
        return cmp(order.index(a), order.index(b))
    elif not order in a:
        return -1
    elif not b in order:
        return 1
    else:
        return 0
dataset/ETHPy150Open rasher/reddit-modbot/modbot.py/rulesorter/swapped operands of `in`