{fdZddlmZddlmZmZmZmZmZm Z m Z ddl m Z ddl m ZddgiZgd ZGd d eZGd d eZGddeZdZeZ eZy)z~ `rich.progress` decorator for iterators. Usage: >>> from tqdm.rich import trange, tqdm >>> for i in trange(10): ... ... )warn) BarColumnProgressProgressColumnTextTimeElapsedColumnTimeRemainingColumnfilesize)TqdmExperimentalWarning)tqdmz github.com/ casperdcl) tqdm_richtrranger trangec*eZdZdZdfd ZdZxZS)FractionColumnz*Renders completed/total, e.g. '0.5/2.3 G'.c>||_||_t| yN) unit_scale unit_divisorsuper__init__)selfrr __class__s R/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/tqdm/rich.pyrzFractionColumn.__init__s$( cNt|j}t|j}|jr't j |gd|j \}}nt j |dgd\}}|dk(rdnd}t||z d|dd||z d|dd|d S) z.Calculate common unit for completed and total. KMGTPEZYr r r,.f/ zprogress.downloadstyle)int completedtotalrr pick_unit_and_suffixrr)rtaskr0r1unitsuffix precisions rrenderzFractionColumn.renders' DJJ ??#88<!!LD& $88aHLD&A ~b 1_-QuTz"YKq.I6( S%' 'r)F__name__ __module__ __qualname____doc__rr7 __classcell__rs@rrrs4 'rrc*eZdZdZdfd ZdZxZS) RateColumnz&Renders human readable transfer speed.cL||_||_||_t|yr)r4rrrr)rr4rrrs rrzRateColumn.__init__0s$ $( rcP|j}|td|jddS|jr't j |gd|j \}}nt j |dgd\}}|dk(rdnd}t||z d |d d ||jddS) zShow data transfer speed.z? z/szprogress.data.speedr-rr r rr)r*r,)speedrr4rr r2r)rr3rDr4r5r6s rr7zRateColumn.render6s  ="TYYKr*2GH H ??#88<!!LD& $88aHLD&A uTz"YKq16(499+RH/1 1r)r Fr8r9r?s@rrArA.s0 1rrAcDeZdZdZfdZfdZdZdZdfd ZxZ S)rz/Experimental rich.progress GUI version of tqdm!c|j}d|d<t|jdd|d<|jdd}|jdij}t ||i||j rytdtd |j}|Ld td t|d |ddtdtdt|d|d |ddf }|jd|j t#|i||_|j$j'|j$j(|j*xsdfi||_y)aZ This class accepts the following parameters *in addition* to the parameters accepted by `tqdm`. Parameters ---------- progress : tuple, optional arguments for `rich.progress.Progress()`. options : dict, optional keyword arguments for `rich.progress.Progress()`. TguidisableFprogressNoptionszrich is experimental/alpha) stacklevelzU[progress.description]{task.description}[progress.percentage]{task.percentage:>4.0f}%) bar_widthrr)rr[<,r4)r4rr] transientr )copyboolgetpoprrrHrr format_dictrrrr rA setdefaultleaver_prog __enter__add_taskdesc_task_id)rargskwargsrIrJdrs rrztqdm_rich.__init__KsTu  Iu!=>y::j$/**Y+002 $)&) <<  )+BqQ     @D) Q~=NP&(#/B/DZQvY1\?-.~->@AD H ;DJJ7x373  + ++DIIOAqA rc|jry|jt| |jj dddyr)rHdisplayrcloserZ__exit__)rrs rrdztqdm_rich.closets5 <<     D$-rcyrr___s rclearztqdm_rich.clear{s rct|dsy|jj|j|j|j y)NrZ)r0 description)hasattrrZupdater^nr]rhs rrcztqdm_rich.display~s4tW%  $--466tyyQrcvt|dr|jj|t| |y)z Resets to 0 iterations for repeated use. Parameters ---------- total : int or float, optional. Total to use for the new bar. rZ)r1N)rnrZresetr)rr1rs rrrztqdm_rich.resets2 4 ! JJ  5  )  E "rr) r:r;r<r=rrdrkrcrrr>r?s@rrrHs'9'BR. R # #rrc&tt|fi|S)z6Shortcut for `tqdm.rich.tqdm(range(*args), **kwargs)`.)rrange)r_r`s rrrs UD\ ,V ,,rN)r=warningsr rich.progressrrrrrr r stdr r std_tqdm __author____all__rrArrrrgrrr{sraaa)!k] + 4'^'2114E#E#P-  r