{fudZddlZddlmZmZddlmZddlmZmZm Z ddl m Z ddl m Z ddl mZdd lmZd d lmZd d lmZmZmZmZmZmZmZmZmZmZmZmZd Z gdZ!Gdde"Z#Gdde$Z%Gdde&Z'Gdde'e(Z)Gdde'e*Z+Gdde'e,Z-dZ.Gdde/Z0Gdde/Z1Gd d!e/Z2Gd"d#eZ3d$Z4y)%z Customisable progressbar decorator for iterators. Includes a default `range` iterator printing to `stderr`. Usage: >>> from tqdm import trange, tqdm >>> for i in trange(10): ... ... N) OrderedDict defaultdict)contextmanager)datetime timedeltatimezone)Number)time)warn)WeakSet)TMonitor) CallbackIOWrapper ComparableDisableOnWriteError FormatReplaceSimpleTextIOWrapper _is_ascii_screen_shape_wrapper_supports_unicode _term_move_updisp_len disp_trimenvwrapz*https://github.com/tqdm/tqdm#contributions)tqdmtrange TqdmTypeError TqdmKeyError TqdmWarningTqdmExperimentalWarningTqdmDeprecationWarningTqdmMonitorWarningc eZdZy)rN__name__ __module__ __qualname__Q/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/tqdm/std.pyrr r)rc eZdZy)rNr$r(r)r*rr$r+r)rc$eZdZdZdfd ZxZS)rzqbase class for all tqdm warnings. Used for non-external-code-breaking errors, such as garbled printing. c|@|d|jjzdzt|jzdzyt ||g|i|y)N : ) __class__r%strrstripsuper__init__)selfmsgfp_writeakr1s r*r5zTqdmWarning.__init__-sR   TDNN333d:SX__=NNQUU V G S *1 * *r)N)r%r&r'__doc__r5 __classcell__)r1s@r*rr(s++r)rceZdZdZy)r z(beta feature, unstable API and behaviourNr%r&r'r<r(r)r*r r 4s2r)r c eZdZy)r!Nr$r(r)r*r!r!9sr)r!ceZdZdZy)r"z>tqdm monitor errors which do not affect external functionalityNr?r(r)r*r"r">sHr)r"cJ ddlm}||i|S#ttf$rYywxYw)zthreading RLockrRLockN) threadingrD ImportErrorOSError)argskwargsrDs r*TRLockrJCs1 #d%f%%  !   s ""c\eZdZdZeZdZdZdZdZ dZ e dZ e dZ y ) TqdmDefaultWriteLocka Provide a default write lock for thread and multiprocessing safety. Works only on platforms supporting `fork` (so Windows is excluded). You must initialise a `tqdm` or `TqdmDefaultWriteLock` instance before forking in order for the write lock to work. On Windows, you need to supply the lock from the parent to the children as an argument to joblib or the parallelism lib you use. ct|}|j}||j|j|j|jfDcgc]}|| c}|_||j yycc}wr;)typeth_lockacquirecreate_mp_lockmp_locklocksrelease)r6cls root_locklks r*r5zTqdmDefaultWriteLock.__init__Zst4jKK      $'KK#=PRbP      !Qs A<A<cJ|jD]}|j|i|yr;)rSrP)r6r9r:locks r*rPzTqdmDefaultWriteLock.acquirefs#JJD DLL! !q !r)cR|jdddD]}|jy)N)rSrT)r6rYs r*rTzTqdmDefaultWriteLock.releasejs"JJtt$D LLN%r)c$|jyr;)rPr6s r* __enter__zTqdmDefaultWriteLock.__enter__n  r)c$|jyr;)rT)r6excs r*__exit__zTqdmDefaultWriteLock.__exit__qr_r)c|t|ds ddlm}||_yy#tt f$r d|_YywxYw)NrRrrC)hasattrmultiprocessingrDrRrFrG)rUrDs r*rQz#TqdmDefaultWriteLock.create_mp_lockts?sI& #1#g ' ) #"  #s ";;cDt|dsJtdtdy)NrOz!create_th_lock not needed anymore stacklevel)rdr r!rUs r*create_th_lockz#TqdmDefaultWriteLock.create_th_lock}s!sI&&& 02HUVWr)N)r%r&r'r<rJrOr5rPrTr^rb classmethodrQrkr(r)r*rLrLLsShG  "##XXr)rLc eZdZdZdZddj eeedddzZ dZ d Z d Z d d d ddddddZ de dfdZedZej"dZdZy)Bara `str.format`-able bar with format specifiers: `[width][type]` - `width` + unspecified (default): use `self.default_len` + `int >= 0`: overrides `self.default_len` + `int < 0`: subtract from `self.default_len` - `type` + `a`: ascii (`charset=self.ASCII` override) + `u`: unicode (`charset=self.UTF` override) + `b`: blank (`charset=" "` override) z 123456789# i%i%r[z zz[38;2;%d;%d;%dmzzzzzzzz)BLACKREDGREENYELLOWBLUEMAGENTACYANWHITE Ncd|cxkrdks*ntdtdtdtd|}|dkDsJ||_||_||_||_y)Nrr zclamping frac to range [0, 1]rgrh)r rmaxminfrac default_lencharsetcolour)r6r}r~rrs r*r5z Bar.__init__sUD~A~ 0+! Lq#a,'DQ &  r)c|jSr;)_colourr]s r*rz Bar.colours ||r)c |sd|_y |j|jvr#|j|j|_y|ddk(r?t|dk(r1|jt d|dd|dd|ddfDz|_yt #t tf$r<td|d d j|jd td d|_YywxYw)Nr#c34K|]}t|dyw)N)int).0is r* zBar.colour..s7N#$C2J7Nsr zUnknown colour (z"); valid choices: [hex (#00ff00), , ]rgrh) rupperCOLOURSlen COLOUR_RGBtupleKeyErrorAttributeErrorr joinr)r6values r*rz Bar.coloursDL  {{} ,#||EKKM: qSSZ1_#7N).qU1QZq(L7N2N N .)  $,,/1 , DL  s>B ABBAC#"C#cR|ro|dj} |j|j|jd|}|dd}|r t |}|dkr5||jz }n%|j}n|j }|j}t|dz }tt |j|z|z|\}}|d|z}||kr|||z|d||z dz zz}|jr|j|z|jzS|S#t$r|j }YwxYw)Nr[)r9ubrr ) lowerASCIIUTFBLANKrrrr~rdivmodr}r COLOUR_RESET) r6 format_spec_typerN_BARSnsyms bar_lengthfrac_bar_lengthress r* __format__zBar.__format__s9 O))+E / $  KER*#2. [)A:d...F))llG%%FG q &,SV1Ce1K-Le&T# ObkJ&  0071:*ATWXAX3YYC8< t{{S 4#4#44LL) ',, 's'DD&%D&)r%r&r'r<rrmapchrrangerrrrrr5propertyrsetterrr(r)r*rnrns  E #c5#<=> >C EL&J": #ZJ!J8G*,S ]]  $Mr)rnc eZdZdZddZddZy)EMAa[ Exponential moving average: smoothing to give progressively lower weights to older values. Parameters ---------- smoothing : float, optional Smoothing factor in range [0, 1], [default: 0.3]. Increase to give more weight to recent values. Ranges from 0 (yields old value) to 1 (yields new value). c.||_d|_d|_y)Nralphalastcalls)r6 smoothings r*r5z EMA.__init__s   r)Ncd|jz }|9|j|z||jzz|_|xjdz c_|jr|jd||jzz z S|jS)zk Parameters ---------- x : float New value to include in EMA. r r)r6xbetas r*__call__z EMA.__call__sl4::~ = Q )99DI JJ!OJ7;zztyyA 223PtyyPr))333333?r;)r%r&r'r<r5rr(r)r*rrs  Qr)rc eZdZdZdZdZeZed/dZ edZ edZ edZ e d0dZ d Zed1d Zed Zed2d Zeed3d ZedZedZedZeddeeeeed d4dZdZdZdZdZdZ dZ!dZ"dZ#e$dZ%dZ&d Z'd5d!Z(d"Z)d6d#Z*d7d$Z+d%Z,d1d&Z-d8d'Z.d8d(Z/d8d)Z0d9d*Z1d+Z2e$d,Z3d:d-Z4eed8d.Z5y);rad Decorate an iterable object, returning an iterator which acts exactly like the original iterable, but prints a dynamically updating progressbar every time a value is requested. Parameters ---------- iterable : iterable, optional Iterable to decorate with a progressbar. Leave blank to manually manage the updates. desc : str, optional Prefix for the progressbar. total : int or float, optional The number of expected iterations. If unspecified, len(iterable) is used if possible. If float("inf") or as a last resort, only basic progress statistics are displayed (no ETA, no progressbar). If `gui` is True and this parameter needs subsequent updating, specify an initial arbitrary large positive number, e.g. 9e9. leave : bool, optional If [default: True], keeps all traces of the progressbar upon termination of iteration. If `None`, will leave only if `position` is `0`. file : `io.TextIOWrapper` or `io.StringIO`, optional Specifies where to output the progress messages (default: sys.stderr). Uses `file.write(str)` and `file.flush()` methods. For encoding, see `write_bytes`. ncols : int, optional The width of the entire output message. If specified, dynamically resizes the progressbar to stay within this bound. If unspecified, attempts to use environment width. The fallback is a meter width of 10 and no limit for the counter and statistics. If 0, will not print any meter (only stats). mininterval : float, optional Minimum progress display update interval [default: 0.1] seconds. maxinterval : float, optional Maximum progress display update interval [default: 10] seconds. Automatically adjusts `miniters` to correspond to `mininterval` after long display update lag. Only works if `dynamic_miniters` or monitor thread is enabled. miniters : int or float, optional Minimum progress display update interval, in iterations. If 0 and `dynamic_miniters`, will automatically adjust to equal `mininterval` (more CPU efficient, good for tight loops). If > 0, will skip display of specified number of iterations. Tweak this and `mininterval` to get very efficient loops. If your progress is erratic with both fast and slow iterations (network, skipping items, etc) you should set miniters=1. ascii : bool or str, optional If unspecified or False, use unicode (smooth blocks) to fill the meter. The fallback is to use ASCII characters " 123456789#". disable : bool, optional Whether to disable the entire progressbar wrapper [default: False]. If set to None, disable on non-TTY. unit : str, optional String that will be used to define the unit of each iteration [default: it]. unit_scale : bool or int or float, optional If 1 or True, the number of iterations will be reduced/scaled automatically and a metric prefix following the International System of Units standard will be added (kilo, mega, etc.) [default: False]. If any other non-zero number, will scale `total` and `n`. dynamic_ncols : bool, optional If set, constantly alters `ncols` and `nrows` to the environment (allowing for window resizes) [default: False]. smoothing : float, optional Exponential moving average smoothing factor for speed estimates (ignored in GUI mode). Ranges from 0 (average speed) to 1 (current/instantaneous speed) [default: 0.3]. bar_format : str, optional Specify a custom bar string formatting. May impact performance. [default: '{l_bar}{bar}{r_bar}'], where l_bar='{desc}: {percentage:3.0f}%|' and r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, ' '{rate_fmt}{postfix}]' Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt, percentage, elapsed, elapsed_s, ncols, nrows, desc, unit, rate, rate_fmt, rate_noinv, rate_noinv_fmt, rate_inv, rate_inv_fmt, postfix, unit_divisor, remaining, remaining_s, eta. Note that a trailing ": " is automatically removed after {desc} if the latter is empty. initial : int or float, optional The initial counter value. Useful when restarting a progress bar [default: 0]. If using float, consider specifying `{n:.3f}` or similar in `bar_format`, or specifying `unit_scale`. position : int, optional Specify the line offset to print this bar (starting from 0) Automatic if unspecified. Useful to manage multiple bars at once (eg, from threads). postfix : dict or *, optional Specify additional stats to display at the end of the bar. Calls `set_postfix(**postfix)` if possible (dict). unit_divisor : float, optional [default: 1000], ignored unless `unit_scale` is True. write_bytes : bool, optional Whether to write bytes. If (default: False) will write unicode. lock_args : tuple, optional Passed to `refresh` for intermediate output (initialisation, iterating, and updating). nrows : int, optional The screen height. If specified, hides nested bars outside this bound. If unspecified, attempts to use environment height. The fallback is 20. colour : str, optional Bar colour (e.g. 'green', '#00ff00'). delay : float, optional Don't display until [default: 0] seconds have elapsed. gui : bool, optional WARNING: internal parameter - do not use. Use tqdm.gui.tqdm(...) instead. If set, will attempt to use matplotlib animations for a graphical output [default: False]. Returns ------- out : decorated iterator. ryNcdD]R}t|dkr=t|dkr$t|dkr |d||cS|d||cS|d||cS||z}T|dd |S) a Formats a number (greater than unity) with SI Order of Magnitude prefixes. Parameters ---------- num : float Number ( >= 1) to format. suffix : str, optional Post-postfix [default: '']. divisor : float, optional Divisor between prefixes [default: 1000]. Returns ------- out : str Number with Order of Magnitude SI unit postfix. )rpr:MGTPEZg<@gX@g= ףp#@z1.2fz2.1f3.0fz3.1fY)abs)numsuffixdivisorunits r* format_sizeofztqdm.format_sizeofrs(z%tqdm.status_printer..sr)cyr;r(r(r)r*rz%tqdm.status_printer..r)cyr;r(r(r)r*rz%tqdm.status_printer..rr)cHjt|yr;)writer2)rfpfp_flushs r*r8z%tqdm.status_printer..fp_writes HHSV  Jr)rcht|}d|zdtd|z dzz|d<y)N ror)rr{)rlen_sr8last_lens r* print_statusz)tqdm.status_printer..print_statuss;QKE TAXs8A;+>'B!BC DHQKr))getattrsysstderrstdout)filerrrr8rs @@@@r*status_printerztqdm.status_printersr2w 5 #**cjj) ) 6GCJJ 6 8 6GCJJ 6 8 3 r)c |r ||dzk\rd}|r|dvr|r||z}||z}|r||z}d}tj|}| |r|| z |z }|rd|z nd}tj}|r|r||n|dnd|zdz}|r|r||n|dndd z|z}|r|dkDr|n|}|r||| }| ||| nd}nt|}| t|nd} | rd | znd } |r |r||z |z nd }|rtj|nd} |r#|r!t j t|zn#t jd tj}|r|dddk(}|r|n|dz}nd }d|d|d|d|d || d }id|d|d|d|d|d|d|d|xsd d|d|r|dkDr|n|d |d!|d"|d#|d$|d%| d&| | |||||d'|}|r*||z }|d(z}||d)d*z }|d k(r |dd+|ddzS|j|,| r'|j|-|s| jd.d } nd/} t} | j d6d0| i|}!| j"s|!St%||rtd|t'|!z nd1|d2urt$j(n|xst$j*| 3} t-| j.st-| r t| } | j d6d0| i|}"|r t1|"|S|"S| r|d4z }|j|d 5t} | j d6d0| i|}!| j"s|!St%d |rtd|t'|!z nd1t$j2| 3} | j d6d0| i|}"|r t1|"|S|"S|r|dznd ||d|d || d S#t$rYwxYw#t$rt j}YwxYw)7a Return a string-based progress bar given some parameters Parameters ---------- n : int or float Number of finished iterations. total : int or float The expected total number of iterations. If meaningless (None), only basic progress statistics are displayed (no ETA). elapsed : float Number of seconds passed since start. ncols : int, optional The width of the entire output message. If specified, dynamically resizes `{bar}` to stay within this bound [default: None]. If `0`, will not print any bar (only stats). The fallback is `{bar:10}`. prefix : str, optional Prefix message (included in total width) [default: '']. Use as {desc} in bar_format string. ascii : bool, optional or str, optional If not set, use unicode (smooth blocks) to fill the meter [default: False]. The fallback is to use ASCII characters " 123456789#". unit : str, optional The iteration unit [default: 'it']. unit_scale : bool or int or float, optional If 1 or True, the number of iterations will be printed with an appropriate SI metric prefix (k = 10^3, M = 10^6, etc.) [default: False]. If any other non-zero number, will scale `total` and `n`. rate : float, optional Manual override for iteration rate. If [default: None], uses n/elapsed. bar_format : str, optional Specify a custom bar string formatting. May impact performance. [default: '{l_bar}{bar}{r_bar}'], where l_bar='{desc}: {percentage:3.0f}%|' and r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, ' '{rate_fmt}{postfix}]' Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt, percentage, elapsed, elapsed_s, ncols, nrows, desc, unit, rate, rate_fmt, rate_noinv, rate_noinv_fmt, rate_inv, rate_inv_fmt, postfix, unit_divisor, remaining, remaining_s, eta. Note that a trailing ": " is automatically removed after {desc} if the latter is empty. postfix : *, optional Similar to `prefix`, but placed at the end (e.g. for additional stats). Note: postfix is usually a string (not a dict) for this method, and will if possible be set to postfix = ', ' + postfix. However other types are supported (#382). unit_divisor : float, optional [default: 1000], ignored unless `unit_scale` is True. initial : int or float, optional The initial counter value [default: 0]. colour : str, optional Bar colour (e.g. 'green', '#00ff00'). Returns ------- out : Formatted meter and stats, ready to display. g?N)Tr Fr z5.2f?z/szs/)rrrpr)secondsr0z| /z [C3q%(5/"9:05 3995CSCGG"(*HX--.9Z3H _ #*##@@K@C,19S%( :s :  SLE   Uq  9$H%J%%B(BkBE)) 1>C3q%(5/"9:#&99V=H$*##@@K@C,19S%( :s :+1 b9gdV2k]"XJwiqJ Ku    "\\F "s% N*A N:* N76N7:OOctj|}|j5|jj ||j rB|j |j js t||j |_ddd|S#t$r/}tdt|ztdd|_Yd}~=d}~wwxYw#1swY|SxYw)Nz>tqdm:disabling monitor support (monitor_interval = 0) due to: rgrhr) object__new__get_lock _instancesaddmonitor_intervalmonitorreportr Exceptionr r2r")rU___instancees r*r)z tqdm.__new__s>>#& \\^ - NN  x (##)<03 0B0B0D-"*30D0D"ECK - !-=?B1vF+;,-C(( - -s0AC5B C#%C C CCCc |jDchc]'}||ur!t|drt|j)}}t t t t|dzj|Scc}w)zSkips specified instance.posr ) r+rdrr6r|setrr difference)rUr3inst positionss r* _get_free_posztqdm._get_free_posso03~~GtH,u1E]G G3uS^a/01<t|dxr|jkS)Nr6)rdr6)rrs r*rz&tqdm._decr_instances..sga/ADAEEMAr)c|jSr;r6)rs r*rz&tqdm._decr_instances..sr))keyTnolockN) _lockr+removerguinrowslistfilterr|clearrr6)rUr3 instancesr9rs @r*_decr_instancesztqdm._decr_instancessYY 1 %%h/ << ,"1 ANN"$% yo>DJJdJ+"8<<0DH% 1 1   1 1s.CB1A=C1 B=:C<B==CC c||ntj}|j||5|j||j|dddy#1swYyxYw)z5Print a message via tqdm (without overlap with bars).N)rrC)rrexternal_write_moder)rUrrendrCrs r*rz tqdm.writesR%T3::  $ $$v $ >  HHQK HHSM   s #AAc#K||ntj} |s|jjg}t |dgD]`}t |ds|j |k(std||j fDs>|jd|j|bd|D]}|jd |s|jjyy#|s|jjwwxYww)z Disable tqdm within context and refresh tqdm when exits. Useful when writing to standard output stream Nr+start_tc3`K|]&}|tjtjfv(ywr;)rrr)rrs r*rz+tqdm.external_write_mode..s+FN:;cjj#**55FNs,.TrB) rrr*rPrrdrallrJappendrefreshrDrT)rUrrCr inst_clearedr9s r*rNztqdm.external_write_modes%T3:: $ &&(L\264+B#FN@BDGG}FNCNJJdJ+ ''-7 $ D )% !!#6 !!#s)D>C&-C&AC&D&DDc||_y)zSet the global lock.N)rD)rUrYs r*set_lockz tqdm.set_locks  r)cPt|dst|_|jS)z7Get the global lock. Construct it if it does not exist.rD)rdrLrDrjs r*r*z tqdm.get_locks"sG$,.CIyyr)c  ddlm}m}ddlm}ddlm  |5|dtddlm }dddd \}} dd l m  dd lm}ddlm}  ddlm}  ddlm} j1j3ddgd fd } | _| |_| d _| d|_| |_| | _| d|_| d|_| d| _ | |_| | | _| | _| d| _| d| _||| |_| |_y | _yy#1swY>xYw#t$rd}YOwxYw#t$r> dd l m n2#t$r& dd lm}dd l m}||fn#t$rdYnwxYwYnwxYwYwxYw#t$r% ddlm} m}n#t$r ddlm} m}YnwxYwYwxYw#t$r ddlm} YwxYw#t$r ddlm} n#t$rd} YnwxYwYwxYw)ae Registers the current `tqdm` class with pandas.core. ( frame.DataFrame | series.Series | groupby.(generic.)DataFrameGroupBy | groupby.(generic.)SeriesGroupBy ).progress_apply A new instance will be created every time `progress_apply` is called, and each instance will automatically `close()` upon completion. Parameters ---------- tqdm_kwargs : arguments for the tqdm instance Examples -------- >>> import pandas as pd >>> import numpy as np >>> from tqdm import tqdm >>> from tqdm.gui import tqdm as tqdm_gui >>> >>> df = pd.DataFrame(np.random.randint(0, 100, (100000, 6))) >>> tqdm.pandas(ncols=50) # can use tqdm_gui, optional kwargs, etc >>> # Now you can use `progress_apply` instead of `apply` >>> df.groupby(0).progress_apply(lambda x: x**2) References ---------- r)catch_warnings simplefilter) DataFrame)Seriesignore)category)PanelNNN)_Rolling_and_Expanding) Expanding)Rolling) SeriesGroupBy)DataFrameGroupBy)rgrf)GroupBy) PanelGroupBy deprecated_tcfd}|S)Ncjdt|dd}|u dk(r |j}nct| r t |}nK t| s=|j dd}|dk(rd}n|dk(rd }|j|j |z} d dd d<n  dd|it |dkDr:td tjd tjj  dd l m } |fd} t| |fi|j#S#t$r|j}YJwxYw#t $rYPwxYw#j#wxYw)aT Parameters ---------- df : (DataFrame|Series)[GroupBy] Data (may be grouped). func : function To be applied on the (grouped) data. **kwargs : optional Transmitted to `df.apply()`. rngroupsNapplymapaxisrindexcolumnsr zExcept func, normal arguments are intentionally not supported by `(DataFrame|Series|GroupBy).progress_apply`. Use keyword arguments instead.rr8)is_builtin_funccjjrjjkrdnd|i|S)Nr r)r)rrr)rHrIfuncrs r*wrapperzDtqdm.pandas..inner_generator..inner..wrappers9 HH133=qaHH000r)r()poprsize isinstancergetshaper!rrrrpandas.core.commonrsrF_is_builtin_funcrclose)dfrurHrIrrorsrvrr^rcrUrj df_function tqdm_kwargss ` @r*innerz3tqdm.pandas..inner_generator..innerRsw$Y1MN="j0 "#B/ #B08(-CD%zz&!47?#$D!Y.#$D "288D> 9 ?.$QA&*LO7%7;7At9q=*:")w 8H8H!I K:B*40D 1372{3GFvFGGI+#:&(&9&9O:!"GGIs0;D4EE4E  E  EEE0r()rrr^rcrUrjrs` r*inner_generatorz$tqdm.pandas..inner_generatorQsE E NLr)rrn aggregate transform)apply)warningsr[r\pandas.core.framer]pandas.core.seriesr^ FutureWarningpandasrarFpandas.core.window.rollingrcpandas.core.windowpandas.core.window.expandingrdrepandas.core.groupby.genericrfrgpandas.core.groupby.groupbypandas.core.groupbyrhricopyrwprogress_apply progress_mapprogress_applymapprogress_aggregateprogress_transform)rUrr[r\r]rarerdrfrgrhrirr^rcrjs`` @@@r*rz tqdm.pandasskF :/- ! )X >( ) ( 2 I P A D  4 ; $ @"&&( #=> H H X!0 1'6'8 $-e4%4U%; "#2#4  *9*;'&5j&A #!0!7 (7(>%  #2#4E  #*9*;L '!0!2%4[%A"%4[%A"  9#8%4%6G "'6'8I $ # /4C4E " 10[ ) ) E   2 2E 22FB-4i-?*"2-1*2  2 2 P PWW POO P P 4 3 3 4  $ $< $#  $ $sFE3FF GH H#3E=8F FF GF#"G# G-F>=G> G  G G  GGGGG H &G/.H /HH HH  H  H H # I -H43I 4 I?I II I TQDM_T)rrminiterspositionrG) is_methodtypesc J|tj}|rt|t|ddxsd}t ||}| t |dr|j sd} || t|}|tdk(rd}| rj||_ | |_ |j5|j||_|j j#|ddd||_||_||_y|rd|_ |j5|j||_|j j#|dddd |vr0t+d t|d tjj, t/d t1|z||"|tjtj2fvs|r9|rt5}|r+||\}}nt5}|r||\}}||}||}| d} d}nd}|d}|d}| t7| } |r| durt9| s t1|}|d}||_ |xsd|_||_||_||_||_||_ ||_!||_"| |_#||_$| |_%| |_ | |_&| |_'||_(||_)||_*||_+||_,||_-||_.t_||_0t_||_1t_||_2||_3d|_4||_5tl|_7|r |jpdddi|||_9||_|j5||j|n| |_ddd|sA|ju|j<|_;|dkr|jy|jT|jo|_=|jz|_>y#ttf$rd}YwwxYw#1swYxYw#1swYxYw#t$r ||_4YwxYw#1swYxYw)zsee tqdm.tqdm for argumentsNencodingzutf-8)r) tqdm_instanceisattyTinfnestedzQ`nested` is deprecated and automated. Use `position` instead for manual control. rrrzUnknown argument(s): rFrprU lock_argsr()?rrrrrrdrrrrfloatiterabledisablerDr;r6r+rErrleaver!rrr2rrrrrrrrG mininterval maxintervalrdynamic_minitersrrrrrrdelayrF dynamic_ncolsrr_ema_dn_ema_dt _ema_minitersrrrr _time set_postfix last_print_nrsprU last_print_trQ) r6rrrrrrrrrrrrrrrrrrrr write_bytesrrGrrrFrI_dynamic_ncols_ncols_nrowsrs r*r5z tqdm.__init__s4 <::D 'wtZ>I'KD#4t< ?wtX6t{{}G =X1 H  E%L E $DM"DL ---d3&&t, -DFDJDJ  DL ---d3&&t, -v% 'C$T7CJJ4D4DEG E 4s6{BC  E]em$3::szz:R2R  5 7  #0#6LE5!6!8!%3D%9NFF} &} &  H# $   K  K =)$//E %t+Ie4DZJ  I! JB     &&  0   $( " *"9~ 9~  ^$    '   ::': $ZZ S3;3Ct))$/(DH S))$''2DGz t~~ 6!JJL(( y~.   - - - -f '&  ' S SsH# O2O)?2O6PPO&%O&)O36PPPP"c|j|jdkDS|j tdt|jS)Nrz/bool() undefined when iterable == total == None)rrrboolr]s r*__bool__z tqdm.__bool__Qs? :: !::> ! == MN NDMM""r)c`|j |jSt|jdr|jjdSt|jdrt |jSt|jdr|jj St |ddS)Nr{r__len____length_hint__r)rrrdr{rrrr]s r*rz tqdm.__len__Xs--/DJJ /+24=='+J$$Q' /(/t}}i'HT]]# /5 > ? !DMs ?)AAA A cht|jdd}|||S||jvS)N __contains__)rrr)r6itemcontainss r*rztqdm.__contains__ks34==.$?!)!5x~R44==?;RRr)c|Sr;r(r]s r*r^ztqdm.__enter__os r)cz |jy#t$r|||fdk(rtdtdYywxYw)N)NNNzAttributeError ignoredrgrh)r~rr r)r6exc_type exc_value tracebacks r*rbz tqdm.__exit__rsB F JJL F)Y/3EE );1 E  Fs $::c$|jyr;)r~r]s r*__del__z tqdm.__del__{s  r)c:|jdi|jS)Nr()r&r#r]s r*__str__z tqdm.__str__~s t  44#3#344r)c.tt|ddS)Nr6l)rrr]s r* _comparableztqdm._comparables74011r)ct|Sr;)idr]s r*__hash__z tqdm.__hash__s $xr)c#6K|j}|jr |D]}|y|j}|j}|j}|j |j z}|j}|j} |D]b}||dz }||z |jk\s|} | |z } | |k\s1| |k\s7|j||z |j}|j}d ||_|jy#||_|jwxYww)z6Backward-compatibility to use: for x in tqdm(iterable)Nr ) rrrrrrQrrrrrr~) r6robjrrr min_start_trr cur_tdts r*rz tqdm.__iter__s == <<  && (( (( llTZZ/ FFzz  Q|#t}}4 FE-B[(Uk-A A $45'+'8'8 '+'8'8  DF JJLDF JJLs0A:D= C=C=0C=6.C=%D=DDc|jry|dkr|xj|z c_|xj|z c_|j|jz |jk\r|j }||j z }||j k\rY||j|jzk\r;|j }|j|jz }|jr&|r$|r"|j||j||j|j|jr|jr5||jk\r&||j xs |jz|z |_n^|jr7|j!||j r|r|j |z ndz|_nt#|j||_|j|_||_yyyy)ag Manually update the progress bar, useful for streams such as reading files. E.g.: >>> t = tqdm(total=filesize) # Initialise >>> for current_buffer in stream: ... ... ... t.update(len(current_buffer)) >>> t.close() The last line is highly recommended, but possibly not necessary if `t.update()` will be called in such a way that `filesize` will be exactly reached and printed. Parameters ---------- n : int or float, optional Increment to add to the internal counter of iterations [default: 1]. If using float, consider specifying `{n:.3f}` or similar in `bar_format`, or specifying `unit_scale`. Returns ------- out : bool or None True if a `display()` was triggered. Nrrr T)rrrrrrrrQrrrrrUrrrrr{)r6rrrdns r*rz tqdm.updates4 <<  q5    "  !  66D%% % 6JJLE***BT%%%%4<<$**3L*L VVd///>>bRLL$LL$ t~~ 6(( ''B$2B2B,B(*d.>.>.R$BRBR(SVX(X (,(:(:4;K;KPR$"2"2R"7'(*)+ ),DMM2(> %)FF!$)!9+M% 7r)cHjryd_tj}jjj j zkrytddyfd} |dj|dk(n j}j5|r#d_ jd |d njd| r |s|d dddy#t$r}dt|vrYd}~yd}~wwxYw#1swYyxYw) z3Cleanup and (if leave=False) close the progressbar.NTrcNjjt|yr;)rrr2)rr6s r*r8ztqdm.close..fp_writes GGMM#a& !r)rpclosedrcyr;r(r(r)r*rztqdm.close..tr)r@r/)r7r6r)rrr6rLrrQrr ValueErrorr2rrDrdisplay)r6r6r8r4rs` r*r~z tqdm.closes <<  $((m T"   t||djj8 8  4t $ ,  "  RL !JJ.qDJJ ZZ #+   #<>* 4>>*  0 r)cF|r|dznd|_|r|jyy)z Set/modify description of the progress bar. Parameters ---------- desc : str, optional refresh : bool, optional Forces refresh [default: True]. r0rpNrrUr6rrUs r*set_descriptionztqdm.set_descriptionfs$$(D4KR  LLN r)c@|xsd|_|r|jyy)z-Set/modify description without ': ' appended.rpNrrs r*set_description_strztqdm.set_description_strtsJB  LLN r)c t|gn|t|jD] }|||< jD]R}t|tr|j ||<.t|t rBt ||<TdjfdjD|_|r|jyy)a8 Set/modify postfix (additional stats) with automatic formatting based on datatype. Parameters ---------- ordered_dict : dict or OrderedDict, optional refresh : bool, optional Forces refresh [default: True]. kwargs : dict, optional Nrc3PK|]}|dz|jzyw)=N)strip)rrArs r*rz#tqdm.set_postfix..s/!<%("%sWS\-?-?-A!A!C'#,/#ws|<  c2"73<0 "yy!<,3LLN!<<  LLN r)cJt||_|r|jyy)zS Postfix without dictionary expansion, similar to prefix handling. N)r2rrU)r6rrUs r*set_postfix_strztqdm.set_postfix_strs 1v  LLN r)c|jjd|zt| zzt|jddy)Nr/rcyr;r(r(r)r*rztqdm.moveto..s$r))rrrr)r6rs r*rz tqdm.movetos9  dQhA2!556/,/1r)c|jr2t|ds&td|j|jdddS|j r(|j |j \|_|_|j|jt|dr|j|jz nd|j|j|j|j|j|j|jr!|j!|jz nd|j"|j$|j&|j(|j*dS) z'Public API for read-only member access.rcyr;r(r(r)r*rz"tqdm.format_dict..rr)rit)rrrrrQN)rrrrrGrrrrrrrrrr)rrdrrrrrrrGrrQrrrrrrrrrrrr]s r*r#ztqdm.format_dicts <<f 5|VVdjjQ.NO O   %)%7%7%@ "DJ $**6=dI6Ntzz|dll2TUZZ$** ZZ$//7;||~DLLNT\\^34//dll --$,,kk# #r)c|t|j}|jxsd}||dz k\r ||k\ry|s|d}t|ds:t dt |j dtjj|r|j||j||jn||r|j| y ) a Use `self.sp` to display `msg` in the specified `pos`. Consider overloading this function when inheriting to use e.g.: `self.some_frontend(**self.format_dict)` instead of `self.sp`. Parameters ---------- msg : str, optional. What to display (default: `repr(self)`). pos : int, optional. Position to `moveto` (default: `abs(self.pos)`). r=r Fz ... (more hidden) ...rzAPlease use `tqdm.gui.tqdm(...)` instead of `tqdm(..., gui=True)` rrrT) rr6rGrdr!rrrrrrrr)r6r7r6rGs r*rz tqdm.displays ;dhh-C  b %!) e|ck.tT"(6 '3::3C3CDF F  KK  #+ 37  KK r)c+K|dd|i|5}|rd|_d|_d|_t|j||dddy#1swYyxYww)a stream : file-like object. method : str, "read" or "write". The result of `read()` and the first argument of `write()` should have a `len()`. >>> with tqdm.wrapattr(file_obj, "read", total=file_obj.size) as fobj: ... while True: ... chunk = fobj.read(chunk_size) ... if not chunk: ... break rBTiNr()rrrrr)rUstreammethodrbytesrrs r*wrapattrz tqdm.wrapattrsY ,u , , ># !%#AHHff= =  > > >s A1A AA A)rp) NrpFrFNNNrrNr;)Nr/F)NF)NNNTNNg?g$@NNFrFFrNrNNrFNNNgF)r )F)FN)NT)rpTrb)6r%r&r'r<r-r.r r+ staticmethodrrrrr&r)rlr;rLrrrNrXr*rrrrr5rrrrr^rbrrrrrrrr~rJrUrrrrrrrr#rrr(r)r*rrs.vpGJ&&:EE$++$2QUKO:>DKDKL II 11:$$8 uFuFp WecW\92 ##""H>>r)rc&tt|fi|S)z*Shortcut for tqdm(range(*args), **kwargs).)rr)rHrIs r*rrs t ' ''r))5r<r collectionsrr contextlibrrrrnumbersr r rr weakrefr _monitorrutilsrrrrrrrrrrrr __author____all__rrrrWarningrrr DeprecationWarningr!RuntimeWarningr"rJr(rLrnrrrr(r)r*rs 0%22    :  !  I  8  +' + k=  [*<  n  4X64XnPM&PMfQ&Q>z>:z>z'(r)