def pop(x):
    if isinstance(x, list):
        if len(x) > 0:
            return x.pop(0)
        else:
            return None
    else:
        try:
            return x.next()
        except StopIteration:
            return None
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/util.py/pop/original