{f*HdZddlZddlZddlmZddlmZddlmZ  dZ ddl Z dZ e dk(rdd lmZdd lmZddlmZdZ ndd l mZdd l mZddl mZ ddlmZdgdiZgdZdZGddeZGdde ZdZ eZe Z!y#e $rZdZ ddl Z e j5e jd d  ddlmcmZ n #e $rYnwxYwdddn #1swYnxYwYwxYw#e $r* dd lmZddlmZddlmZdZ n#e $r dZ dZeZYnwxYwYwxYw#e $rYwxYw)z IPython/Jupyter Notebook progressbar decorator for iterators. Includes a default `range` iterator printing to `stderr`. Usage: >>> from tqdm.notebook import trange, tqdm >>> for i in trange(10): ... ... N)escape)proxy)tqdm ignorez2.*The `IPython.html` package has been deprecated.*)message)HTML) FloatProgress)HBox)ContainerWidget)FloatProgressWidget)displayz github.com/)lrq3000 casperdcl alexanderkuk) tqdm_notebooktnrangertrangez|IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.htmlc2eZdZdZddZdfd ZdZxZS)TqdmHBoxz.`ipywidgets.HBox` with a pretty representationcPt|dd}|iS|j}|| |d<|S)Npbarascii)getattr format_dict)selfprettyrds V/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/tqdm/notebook.py_json_zTqdmHBox._json_Gs;tVT* <I     #AgJct|dd}|t| S|jdi|j |S)Nr)rsuper__repr__ format_meterr$)r r!r __class__s r#r)zTqdmHBox.__repr__PsCtVT* <7#% % t  74;;v#677r%cD|j|jdy)NT)textr))r pp___s r# _repr_pretty_zTqdmHBox._repr_pretty_Vs  d#$r%N)F)__name__ __module__ __qualname____doc__r$r)r1 __classcell__r+s@r#rrEs88 %r%rceZdZdZed dZ d dZedZejdZfdZ fdZ dfd Z fd Z d Zdfd ZxZS)rzB Experimental IPython/Jupyter Notebook widget using tqdm! cttt|rtd|}n.tdd}d|_d|_|d|j _t}t}|r||_t|||g}|ct|} t|dkDr|dz }d|j _ ||j _d |j _ d |j _|S#t$rYQwxYw) zY Manage the printing of an IPython/Jupyter Notebook progress bar widget. r)minmaxrinfo20px)childrenpx2z inline-flexzrow wrap) IProgress ImportError WARN_NOIPYWvalue bar_stylelayoutwidthr rstrint ValueErrorflexr flex_flow)r/totaldescncolsrltextrtext containers r#status_printerztqdm_notebook.status_printer^s  k* * .D*DDJ#DN}$* ! EKudE&:;  JE u:>TME #DKK %*I   "'4I   $)3I   &  sC'' C32C3c|s<|s:|j}|dxsdjdd|d<|jdi|}|jj\}}} |j |_|r]|jdd}d|vr*tttjd|d \} } n d t|} } | |_| r| | _|r|jd k7s|d k7r||_ |rE|jd k7r6 |jjd|jj_|r:|j"dkDr*|j$st'|jd|_yyyy#t$rd |j_YtwxYw)N bar_formatz{l_bar}{r_bar}z{bar}z u z \|?\|?r)maxsplitdangersuccessFhiddenrTr')rreplacer*rSr?nrEmaprresplitrFcloseAttributeErrorvisiblerG visibilitydelay displayedr) r msgposrbrF check_delayr"rQrrRleftrights r#rztqdm_notebook.displaysl5  A H2HQQ#AlO#$##(a(C!^^44tUVV ++c9-C3!&"((?CRS*TU e &+eEK#  ~~)Y)-C!* T^^x/ /$$&08DNN ! ! , 4::>$.. DNN #!DN3A>; " /).& /s8E**FFcvt|dr-|jjdjjSyNrShasattrrSr?style bar_color)r s r#colourztqdm_notebook.colours2 4 %>>**2.44>> > &r%cnt|dr)||jjdj_yyrnrp)r rss r#rtztqdm_notebook.colours. 4 %:CDNN # #B ' - - 7 &r%c|j}|jdtj}|tjus|tj|d<d|d<t |jdd|d<|j dd}|j dd}t| |i||js|ds d |_ y|jrd n|jd d|_ |jdurd n|jxsd }|jr|j|zn |j}|j|j ||j"|j|_t'||j$_d|_|r+|j,d krt/|j$d|_|j.|_ ||_|js|j/dyy)z Supports the usual `tqdm.tqdm` parameters as well as those listed below. Parameters ---------- display : Whether to call `display(self.container)` immediately [default: True]. fileNTguidisableFrtrcyr2r')r/r0s r#z(tqdm_notebook.__init__..sr%z100%rPrr)rj)copygetsysstderrstdoutboolpopr(__init__rydisp dynamic_ncolsrP unit_scalerNrTfprOrSrrrgrfrrt) r argskwargs file_kwargrt display_hererrNr+s r#rztqdm_notebook.__init__sZZ 3  #z'9 ZZF6Nu  Iu!=>yHd+zz)T2  $)&) <A>& &  III ) s(c|jryt| |jr-|j|jkr|j ddy|j r|j ddy|j ddy)NrZF)rFrjr[T)rbrj)ryr(rbrNr^rleave)r r+s r#rbztqdm_notebook.closese <<    ::$&&4::- IIeI <zz I5 A % 8r%cyr2r')r r/r0s r#clearztqdm_notebook.clears r%c|jrt| |S|jj\}}}d|_|0||_|js|jd|j_ t| |S)z Resets to 0 iterations for repeated use. Consider combining with `leave=True`. Parameters ---------- total : int or float, optional. Total to use for the new bar. )rNrYN) ryr(resetrSr?rFr<rNrPrGrH)r rNr/rr+s r#rztqdm_notebook.reset!ss <<7=u=- -^^,, 4  DH::$**"4$( !w}5}))r%)NNN)NNFNT)rr2)r3r4r5r6 staticmethodrTrpropertyrtsetterrrrrbrrr7r8s@r#rrZs}**X%)9=3"j?? ]]DD+,Z  9 **r%rc&tt|fi|S)z:Shortcut for `tqdm.notebook.tqdm(range(*args), **kwargs)`.)rrange)rrs r#rr6s  0 00r%)"r6r`r~htmlrweakrefrstdrstd_tqdmIPY ipywidgetsrCwarningscatch_warningsfilterwarningsIPython.html.widgetswidgetsr r rBr rrobjectIPython.displayr __author____all__rDrrrrr'r%r#rsg " C  "9 1 G 1C ' = ' +E F 8$ %t%*Y*HY*x1  I   $X $ $ &  #H # #"V X 99       *    1 D MC CID      sB,C'DC$!C7 CCC CC  C C$C C$#C$'D-DD D DDDDD! D!