<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def window(seq, n=2):
 """ Yield a sliding window over an iterable. Args: seq (iter):
 The sequence. n (int):
 The window width. Yields: tuple: The next window. """


    it = iter(seq)
    result = tuple(islice(it, n))

    if len(result) == n:
        yield result

    for token in it:
        result = result[1:] + (token,)
        yield result