Adding all project files
This commit is contained in:
parent
6c9e127bdc
commit
cd4316ad0f
42289 changed files with 8009643 additions and 0 deletions
29
venv/Lib/site-packages/tqdm/autonotebook.py
Normal file
29
venv/Lib/site-packages/tqdm/autonotebook.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""
|
||||
Automatically choose between `tqdm.notebook` and `tqdm.std`.
|
||||
|
||||
Usage:
|
||||
>>> from tqdm.autonotebook import trange, tqdm
|
||||
>>> for i in trange(10):
|
||||
... ...
|
||||
"""
|
||||
import sys
|
||||
from warnings import warn
|
||||
|
||||
try:
|
||||
get_ipython = sys.modules['IPython'].get_ipython
|
||||
if 'IPKernelApp' not in get_ipython().config: # pragma: no cover
|
||||
raise ImportError("console")
|
||||
from .notebook import WARN_NOIPYW, IProgress
|
||||
if IProgress is None:
|
||||
from .std import TqdmWarning
|
||||
warn(WARN_NOIPYW, TqdmWarning, stacklevel=2)
|
||||
raise ImportError('ipywidgets')
|
||||
except Exception:
|
||||
from .std import tqdm, trange
|
||||
else: # pragma: no cover
|
||||
from .notebook import tqdm, trange
|
||||
from .std import TqdmExperimentalWarning
|
||||
warn("Using `tqdm.autonotebook.tqdm` in notebook mode."
|
||||
" Use `tqdm.tqdm` instead to force console mode"
|
||||
" (e.g. in jupyter console)", TqdmExperimentalWarning, stacklevel=2)
|
||||
__all__ = ["tqdm", "trange"]
|
Loading…
Add table
Add a link
Reference in a new issue