def avg(a, b):
    if (types.TupleType, types.ListType) in type(a) and \
            type(b) in (types.TupleType, types.ListType) and \
            len(a) == len(b):
        return tuple([avg(a[i], b[i]) for i in range(len(a))])
    else:
        return (a + b)/2.0
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/util.py/avg/swapped operands of `in`