<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def progressbar(stream, prefix='Loading: ', width=0.5, **options):
 """ Generator filter to print a progress bar. """

    size = len(stream)
    if not size:
        return stream
    if 'width' not in options:
        if width <= 1:
            width = round(shutil.get_terminal_size()[0] * width)
        options['width'] = width
    with ProgressBar(max=size, prefix=prefix, **options) as b:
        b.set(0)
        for i, x in enumerate(stream, 1):
            yield x
            b.set(i)