<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def uniq(pipe):
    ''' this works like bash's uniq command where the generator only iterates
        if the next value is not the previous '''
    pipe = iter(pipe)
    previous = next(pipe)
    yield previous
    for i in pipe:
        if i is not previous:
            previous = i
            yield i