def pairwise(iterable):
    a, b = itertools.tee(iterable)
    next(b, None)
    return itertools.izip(a, b)
documentation
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/helper/tools.py/pairwise--crossover with--dataset/ETHPy150Open GrahamDumpleton/wrapt/tests/test_instancemethod.py/OldClass1.function