__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
from functools import partial
from dask.callbacks import Callback
from .auto import tqdm as tqdm_auto
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['TqdmCallback']
class TqdmCallback(Callback):
"""Dask callback for task progress."""
def __init__(self, start=None, pretask=None, tqdm_class=tqdm_auto,
**tqdm_kwargs):
"""
Parameters
----------
tqdm_class : optional
`tqdm` class to use for bars [default: `tqdm.auto.tqdm`].
tqdm_kwargs : optional
Any other arguments used for all bars.
"""
super().__init__(start=start, pretask=pretask)
if tqdm_kwargs:
tqdm_class = partial(tqdm_class, **tqdm_kwargs)
self.tqdm_class = tqdm_class
def _start_state(self, _, state):
self.pbar = self.tqdm_class(total=sum(
len(state[k]) for k in ['ready', 'waiting', 'running', 'finished']))
def _posttask(self, *_, **__):
self.pbar.update()
def _finish(self, *_, **__):
self.pbar.close()
def display(self):
"""Displays in the current cell in Notebooks."""
container = getattr(self.bar, 'container', None)
if container is None:
return
from .notebook import display
display(container)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| contrib | Folder | 0755 |
|
|
| __init__.py | File | 1.54 KB | 0644 |
|
| __main__.py | File | 30 B | 0644 |
|
| _dist_ver.py | File | 23 B | 0644 |
|
| _main.py | File | 283 B | 0644 |
|
| _monitor.py | File | 3.61 KB | 0644 |
|
| _tqdm.py | File | 283 B | 0644 |
|
| _tqdm_gui.py | File | 287 B | 0644 |
|
| _tqdm_notebook.py | File | 307 B | 0644 |
|
| _tqdm_pandas.py | File | 888 B | 0644 |
|
| _utils.py | File | 553 B | 0644 |
|
| asyncio.py | File | 2.69 KB | 0644 |
|
| auto.py | File | 871 B | 0644 |
|
| autonotebook.py | File | 956 B | 0644 |
|
| cli.py | File | 10.75 KB | 0644 |
|
| dask.py | File | 1.29 KB | 0644 |
|
| gui.py | File | 5.35 KB | 0644 |
|
| keras.py | File | 4.27 KB | 0644 |
|
| notebook.py | File | 10.64 KB | 0644 |
|
| rich.py | File | 4.9 KB | 0644 |
|
| std.py | File | 56.11 KB | 0644 |
|
| tk.py | File | 6.54 KB | 0644 |
|
| utils.py | File | 11.54 KB | 0644 |
|
| version.py | File | 333 B | 0644 |
|