this function repeats each value in the pipeline however many times you need

def repeater(pipe, how_many=2):
    ''' this function repeats each value in the pipeline however many times you need '''
    r = range(how_many)
    for i in pipe:
        for _ in r:
            yield i