def bicycle(iterable, repeat=1):
    for item in itertools.cycle(iterable):
        for _ in range(repeat):
            yield item
c = bicycle([1, 2, 3, 4], 2)
How to iterate over a list repeating each element in Python