def pairwise(iterator):
    itr = iter(iterator)
    while True:
        yield tuple([next(itr) for i in range(2)])
Iterate over list taking two elements at a time.
dataset/ETHPy150Open curtacircuitos/pcb-tools/gerber/excellon_statements.py/pairwise