# AUTOGENERATED! DO NOT EDIT! File to edit: 01_tqdm.ipynb (unless otherwise specified).

__all__ = ['ProgressParallel']

# Cell
import joblib
from tqdm.auto import tqdm

class ProgressParallel(joblib.Parallel):
    def __call__(self, *args, **kwargs):
        with tqdm(total=kwargs["total"]) as self._pbar:
            del kwargs["total"]
            return joblib.Parallel.__call__(self, *args, **kwargs)

    def print_progress(self):
        self._pbar.n = self.n_completed_tasks
        self._pbar.refresh()