def progress(iterator, enum=False, length=None):
    progress = ProgressBar()
    length = len(iterator) if length is None else length
    gen = enumerate(iterator)
    while True:
        i, val = next(gen)
        progress((i+1.0)/length * 100)
        if enum:
            yield i, val
        else:
            yield val
A helper utility to display a progress bar when iterating over a
dataset/ETHPy150Open ioam/holoviews/holoviews/ipython/widgets.py/progress