def repeatlast(it):
    for item in it:
        yield item
    while 1: # pragma: no cover
        yield item
Iterate over all elements in the iterator, and when its exhausted
dataset/ETHPy150Open ask/carrot/carrot/utils.py/repeatlast