Iterates lazily through a sequence looking at a sliding window
    with given size, for each time.

    each_cons([1, 2, 3, 4], 2) --> [(0, 1), (1, 2), (2, 3), (3, 4)]

def each_cons(sequence, size):
    """Iterates lazily through a sequence looking at a sliding window
    with given size, for each time.

    each_cons([1, 2, 3, 4], 2) --> [(0, 1), (1, 2), (2, 3), (3, 4)]
    """
    return zip(*(islice(it, start, None)
                 for start, it in enumerate(tee(sequence, size))))