WITH values = [a, b, c, d, ...]
    RETURN [(a, b), (b, c), (c, d), ...]

def pairwise(values):
    """
    WITH values = [a, b, c, d, ...]
    RETURN [(a, b), (b, c), (c, d), ...]
    """
    i = iter(values)
    a = next(i)

    for b in i:
        yield (a, b)
        a = b