/usr/lib/python3/dist-packages/pyprind/generator_factory.py is in python3-pyprind 2.11.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # PyPrind
# Author: Sebastian Raschka <mail@sebastianraschka.com>
# Contributors: https://github.com/rasbt/pyprind/graphs/contributors
# License: BSD 3 clause
# Code Repository: https://github.com/rasbt/pyprind
# PyPI: https://pypi.python.org/pypi/PyPrind
from .progbar import ProgBar
from .progpercent import ProgPercent
def generator_factory(mother_class):
def generator_progress(iteritem, iterations=None, *args, **kw):
if iterations is None:
iterations = len(iteritem)
assert iterations
mbar = mother_class(iterations, *args, **kw)
for item in iteritem:
yield item
mbar.update()
return generator_progress
prog_percent = generator_factory(ProgPercent)
prog_bar = generator_factory(ProgBar)
|