+
    <j                        ^ RI t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RI HtHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHtHt ^ RIHtHtHt ^ RIHt ^ RIHtHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/ ]P`                  R8  d   ^ RIH1t1 M^ RI2H1t1 ]P`                  R8  d   ^ RIH3t3 M^ RI2H3t3 ^RI4H5t5H6t6 ^RI7H8t8H9t9H:t:H;t; ^RI<H=t= ^RI>H?t? ^RI@HAtA ^RIBHCtC ^RIDHEtE ^RIFHGtG ^RIHHItIHJtJ ^RIKHLtLHMtM ](! R]N4      tO].! R4      tP] . ]Q3,          tR]P\                  ! R]+]4      tS ! R R]4      tTRR% R& lltU ! R' R(]]4      tV ! R) R*]!]S,          ]$]S,          4      tWR+R,R-RR.RR/R R0RR1^
R2R!R3R"R4R#R5R$R6R /R7 R8 lltX]P                  RR9RR+R,R-RR.RR/R R0RR1^
R2R!R3R"R4R#R5R$R6R /R: R; lll4       tZ]P                  RR9RR+R,R-RR.RR/R R0RR1^
R2R!R3R"R4R#R5R$R6R /R< R= lll4       tZRR9RR+R,R-RR.RR/R R0RR1^
R2R!R3R"R4R#R5R$R6R /R> R? llltZ ! R@ RA]4      t[ ! RB RC][4      t\ ! RD RE][4      t] ! RF RG][4      t^ ! RH RI][4      t_ ! RJ RK][4      t` ! RL RM]^4      ta ! RN RO][4      tb ! RP RQ][4      tc ! RR RS][4      td ! RT RU][4      te ! RV RW][4      tf ! RX RY][4      tg ! RZ R[]'4      th]
 ! R\ R]4      4       ti ! R^ R_]?4      tj]kR`8X  Edr   ^ RIltl^ RImtm^RaInHoto ^RbIpHqtq ^RcIrHsts ^RdIHHJtJ ]s! ReRfRRg7      tr]J! RhRiRj4      tH]HP                  RkRlRm4       Rn]o! Ro4      Rp]HRqRrRsRtRu/Rv]r]q! Rw4      .	tu^ RxIvHwtw ]w! ]u4      tx]8! RRy7      t7]j! ]]! 4       .]jP                  4       O]`! 4       N5R.]7R/R / ;_uu_ 4       tz]zP                  RzR{R|7      t|]zP                  R}R{R|7      t}]zP                  R~RR|7      t~]zP                  '       gq   ]zEP                  ]|RR7       ]zEP                  ]}RR7       ]mEP                  ! R4       ]lEP                  ! ^ ^d4      ^8  g   Kh  ]zEP                  ]! ]x4      4       K   RRR4       R# R#   + '       g   i     R# ; i)    N)ABCabstractmethoddeque)	dataclassfield)	timedelta)	RawIOBaseUnsupportedOperation)ceil)mmap)length_hint)PathLikestat)EventRLockThread)TracebackType)AnyBinaryIOCallableContextManagerDequeDictGenericIterableList
NamedTupleNewTypeOptionalSequenceTextIOTupleTypeTypeVarUnion)LiteralSelf)filesizeget_console)ConsoleGroupJustifyMethodRenderableType)Highlighter)JupyterMixin)LiveProgressBar)Spinner)	StyleType)ColumnTable)TextTextTypeTaskIDProgressType_Ic                   x   a a ] tR t^Dt oRtV3R lV 3R lltV3R lR ltV3R lR ltV3R lR	 ltR
t	Vt
V ;t# )_TrackThreadz)A thread to periodically update progress.c                (   < V ^8  d   QhRRRRRS[ /# )   progressProgresstask_idr;   update_periodfloat)format__classdict__s   "N/opt/headortail/venv/lib/python3.14/site-packages/pip/_vendor/rich/progress.py__annotate___TrackThread.__annotate__G   s"     & & &h &u &    c                x   < Wn         W n        W0n        \        4       V n        ^ V n        \        SV `  RR7       R# )r   T)daemonN)rB   rD   rE   r   done	completedsuper__init__)selfrB   rD   rE   	__class__s   &&&&rJ   rS   _TrackThread.__init__G   s3     *G	%rM   c                   < V ^8  d   QhRR/# rA   returnN )rH   rI   s   "rJ   rK   rL   P   s     S ST SrM   c                   V P                   pV P                  P                  pV P                  p^ pV P                  P
                  pV! V4      '       gN   V P                  P                  P                  '       d(   V P                  pWF8w  g   KH  V! WV,
          4       TpK[  V P                  P                  V P                   V P                  RR7       R# )r   T)rQ   refreshN)
rD   rB   advancerE   rP   waitlive
is_startedrQ   update)rT   rD   r]   rE   last_completedr^   rQ   s   &      rJ   run_TrackThread.runP   s    ,,--''**yy~~}%%$--*<*<*G*G*GI*^!;<!*T\\T^^TRrM   c                   < V ^8  d   QhRR/# )rA   rY   r?   rZ   )rH   rI   s   "rJ   rK   rL   ^   s      > rM   c                &    V P                  4        V # NstartrT   s   &rJ   	__enter___TrackThread.__enter__^       

rM   c                p   < V ^8  d   QhRS[ S[S[,          ,          RS[ S[,          RS[ S[,          RR/# rA   exc_typeexc_valexc_tbrY   Nr    r$   BaseExceptionr   )rH   rI   s   "rJ   rK   rL   b   sG      4./ -( '	
 
rM   c                Z    V P                   P                  4        V P                  4        R # rg   )rP   setjoinrT   rp   rq   rr   s   &&&&rJ   __exit___TrackThread.__exit__b   s     					rM   )rQ   rP   rB   rD   rE   )__name__
__module____qualname____firstlineno____doc__rS   rc   rk   ry   __static_attributes____classdictcell____classcell__rU   rI   s   @@rJ   r?   r?   D   s7     3& &S S   rM   r?   TFbar.backbar.completebar.finished	bar.pulsec          #         V ^8  d   QhR\         \        \        ,          \        \        ,          3,          R\        R\
        \        ,          R\        R\        R\
        \        ,          R\        R\
        \        . \        3,          ,          R	\        R
\        R\        R\        R\        R\        R\        R\        R\        \        ,          /# )rA   sequencedescriptiontotalrQ   auto_refreshconsole	transientget_timerefresh_per_secondstylecomplete_stylefinished_stylepulse_stylerE   disable
show_speedrY   )r&   r!   r<   r   strr    rG   intboolr,   r   r6   )rH   s   "rJ   rK   rK   l   s     I
 I
H\*H\,BBCI
I
 E?I
 	I

 I
 gI
 I
 xE	*+I
 I
 I
 I
 I
 I
 I
 I
  !I
" l#I
rM   c              #  p  "   V'       d   \        R4      .M. pVP                  \        V	V
VVR7      \        VR7      \	        RR7      34       \        TRTRTRTR	TR
T;'       g    ^
RV/ pT;_uu_ 4        VP                  V VVVVR7       Rj  xL
  RRR4       R#  L  + '       g   i     R# ; i5i)a  Track progress by iterating over a sequence.

Args:
    sequence (Iterable[ProgressType]): A sequence (must support "len") you wish to iterate over.
    description (str, optional): Description of task show next to progress bar. Defaults to "Working".
    total: (float, optional): Total number of steps. Default is len(sequence).
    completed (int, optional): Number of steps completed so far. Defaults to 0.
    auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
    transient: (bool, optional): Clear the progress on exit. Defaults to False.
    console (Console, optional): Console to write to. Default creates internal Console instance.
    refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
    style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
    complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
    finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
    pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
    update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1.
    disable (bool, optional): Disable display of progress.
    show_speed (bool, optional): Show speed if total isn't known. Defaults to True.
Returns:
    Iterable[ProgressType]: An iterable of the values in the sequence.

([progress.description]{task.description}r   r   r   r   )r   T)elapsed_when_finishedr   r   r   r   r   r   )r   rQ   r   rE   N)
TextColumnextend	BarColumnTaskProgressColumnTimeRemainingColumnrC   track)r   r   r   rQ   r   r   r   r   r   r   r   r   r   rE   r   r   columnsrB   s   &&&&&&&&&&&&&&&&  rJ   r   r   l   s     T EP>	?@UW  NN--'	 *5d;		
 	!  	
  .33 H 
>>#' " 
 	
 	
 
	
 
s0   A5B67B"B B"
B6 B""B3	-	B6c                     a  ] tR t^t o RtR0V 3R lR lltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	]
V 3R lR l4       tV 3R lR ltV 3R lR lt]
V 3R lR l4       t]
V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltR1V 3R lR lltV 3R lR ltR1V 3R  lR! lltR1V 3R" lR# lltV 3R$ lR% ltR2V 3R& lR' lltV 3R( lR) ltV 3R* lR+ ltV 3R, lR- ltR.tV tR/# )3_Readerz9A reader that tracks progress while it's being read from.c          
      4   < V ^8  d   QhRS[ RRRS[RS[RR/# )rA   handlerB   rC   taskclose_handlerY   N)r   r;   r   )rH   rI   s   "rJ   rK   _Reader.__annotate__   s=        	
  
rM   c                D    Wn         W n        W0n        W@n        R V n        R# FN)r   rB   r   r   _closed)rT   r   rB   r   r   s   &&&&&rJ   rS   _Reader.__init__   s       	(rM   c                   < V ^8  d   QhRR/# )rA   rY   r   rZ   )rH   rI   s   "rJ   rK   r      s      9 rM   c                :    V P                   P                  4        V # rg   )r   rk   rj   s   &rJ   rk   _Reader.__enter__   s    rM   c                p   < V ^8  d   QhRS[ S[S[,          ,          RS[ S[,          RS[ S[,          RR/# ro   rs   )rH   rI   s   "rJ   rK   r      sG      4./ -( '	
 
rM   c                &    V P                  4        R # rg   )closerx   s   &&&&rJ   ry   _Reader.__exit__   s     	

rM   c                    < V ^8  d   QhRS[ /# rA   rY   )r   )rH   rI   s   "rJ   rK   r      s      ( rM   c                    V # rg   rZ   rj   s   &rJ   __iter___Reader.__iter__   s    rM   c                    < V ^8  d   QhRS[ /# r   )bytes)rH   rI   s   "rJ   rK   r      s      % rM   c                    \        V P                  4      pV P                  P                  V P                  \        V4      R 7       V# r]   )nextr   rB   r]   r   len)rT   lines   & rJ   __next___Reader.__next__   s4    DKK diiT;rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r      s       rM   c                    V P                   # rg   )r   rj   s   &rJ   closed_Reader.closed   s    ||rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r      s     $ $ $rM   c                6    V P                   P                  4       # rg   )r   filenorj   s   &rJ   r   _Reader.fileno       {{!!##rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r      s     $ $ $rM   c                6    V P                   P                  4       # rg   )r   isattyrj   s   &rJ   r   _Reader.isatty   r   rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r              c  rM   c                .    V P                   P                  # rg   )r   moderj   s   &rJ   r   _Reader.mode       {{rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r      r   rM   c                .    V P                   P                  # rg   )r   namerj   s   &rJ   r   _Reader.name   r   rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r           & &$ &rM   c                6    V P                   P                  4       # rg   )r   readablerj   s   &rJ   r   _Reader.readable       {{##%%rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r      r   rM   c                6    V P                   P                  4       # rg   )r   seekablerj   s   &rJ   r   _Reader.seekable   r   rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r      s      $ rM   c                    R # )FrZ   rj   s   &rJ   writable_Reader.writable   s    rM   c                &   < V ^8  d   QhRS[ RS[/# rA   sizerY   r   r   )rH   rI   s   "rJ   rK   r      s       e rM   c                    V P                   P                  V4      pV P                  P                  V P                  \        V4      R 7       V# r   )r   readrB   r]   r   r   )rT   r   blocks   && rJ   r   _Reader.read   s:      &diiU<rM   c                :   < V ^8  d   QhRS[ S[S[S[3,          /# )rA   b)r&   	bytearray
memoryviewr   )rH   rI   s   "rJ   rK   r      s       %	:t ;< rM   c                    V P                   P                  V4      pV P                  P                  V P                  VR 7       V# r   )r   readintorB   r]   r   )rT   r   ns   && rJ   r   _Reader.readinto   s6    KK  #dii3rM   c                &   < V ^8  d   QhRS[ RS[/# r   r   )rH   rI   s   "rJ   rK   r     s      S % rM   c                    V P                   P                  V4      pV P                  P                  V P                  \        V4      R 7       V# r   )r   readlinerB   r]   r   r   )rT   r   r   s   && rJ   r   _Reader.readline  s:    {{##D)diiT;rM   c                6   < V ^8  d   QhRS[ RS[S[,          /# )rA   hintrY   )r   r   r   )rH   rI   s   "rJ   rK   r     s      c 4; rM   c           	         V P                   P                  V4      pV P                  P                  V P                  \        \        \        V4      4      R 7       V# r   )r   	readlinesrB   r]   r   summapr   )rT   r  liness   && rJ   r  _Reader.readlines  sA    %%d+diiSe_1EFrM   c                   < V ^8  d   QhRR/# rX   rZ   )rH   rI   s   "rJ   rK   r     s      t rM   c                l    V P                   '       d   V P                  P                  4        R V n        R# )TN)r   r   r   r   rj   s   &rJ   r   _Reader.close  s%    KKrM   c                ,   < V ^8  d   QhRS[ RS[ RS[ /# )rA   offsetwhencerY   r   )rH   rI   s   "rJ   rK   r     s"      3  C rM   c                    V P                   P                  W4      pV P                  P                  V P                  VR 7       V# )rQ   )r   seekrB   ra   r   )rT   r  r  poss   &&& rJ   r  _Reader.seek  s6    kkv.TYY#6
rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r     s     " "c "rM   c                6    V P                   P                  4       # rg   )r   tellrj   s   &rJ   r  _Reader.tell  s    {{!!rM   c                &   < V ^8  d   QhRS[ RS[/# )rA   srY   )r   r   )rH   rI   s   "rJ   rK   r     s     , ,s ,s ,rM   c                    \        R 4      h)writer   )rT   r  s   &&rJ   r  _Reader.write  s    "7++rM   c                4   < V ^8  d   QhRS[ S[,          RR/# )rA   r  rY   N)r   r   )rH   rI   s   "rJ   rK   r     s     1 1 1$ 1rM   c                    \        R 4      h)
writelinesr  )rT   r  s   &&rJ   r!  _Reader.writelines  s    "<00rM   )r   r   r   rB   r   N)T))r   )r{   r|   r}   r~   r   rS   rk   ry   r   r   propertyr   r   r   r   r   r   r   r   r   r   r   r  r   r  r  r  r!  r   r   rI   s   @rJ   r   r      s    C     
  $ $$ $        & && &  
 
 
 
 
 
" ", ,1 1rM   r   c                   Z   a  ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltR	tV t	R
# )_ReadContexti  zEA utility class to handle a context for both a reader and a progress.c                (   < V ^8  d   QhRRRS[ RR/# )rA   rB   rC   readerrY   Nr=   )rH   rI   s   "rJ   rK   _ReadContext.__annotate__"  s"     ! ! !R !D !rM   c                    Wn         W n        R # rg   rB   r)  )rT   rB   r)  s   &&&rJ   rS   _ReadContext.__init__"  s      rM   c                    < V ^8  d   QhRS[ /# r   r*  )rH   rI   s   "rJ   rK   r+  &  s     ' '2 'rM   c                j    V P                   P                  4        V P                  P                  4       # rg   )rB   ri   r)  rk   rj   s   &rJ   rk   _ReadContext.__enter__&  s%    {{$$&&rM   c                p   < V ^8  d   QhRS[ S[S[,          ,          RS[ S[,          RS[ S[,          RR/# ro   rs   )rH   rI   s   "rJ   rK   r+  *  sG     8 84./8 -(8 '	8
 
8rM   c                r    V P                   P                  4        V P                  P                  WV4       R # rg   )rB   stopr)  ry   rx   s   &&&&rJ   ry   _ReadContext.__exit__*  s(     	X7rM   r-  N)
r{   r|   r}   r~   r   rS   rk   ry   r   r   r%  s   @rJ   r'  r'    s&     O! !' '8 8rM   r'  r   
Reading...r   r   r   r   r   r   r   r   r   r   c                   V ^8  d   QhR\         R\        R\        R\        R\        \
        ,          R\        R\        \        . \        3,          ,          R\        R	\        R
\        R\        R\        R\        R\        \         ,          /# )rA   filer   r   r   r   r   r   r   r   r   r   r   r   rY   )
r   r   r   r   r    r,   r   rG   r6   r   )rH   s   "rJ   rK   rK   4  s     >* >*
>*>* 	>*
 >* g>* >* xE	*+>* >* >* >* >* >* >* H>*rM   c               
   V'       d   \        R4      .M. pVP                  \        VV	V
VR7      \        4       \	        4       34       \        TRTRTRTRTRT;'       g    ^
RV/ pVP                  WVR	7      p\        W4      # )
a  Read bytes from a file while tracking progress.

Args:
    file (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode.
    total (int): Total number of bytes to read.
    description (str, optional): Description of task show next to progress bar. Defaults to "Reading".
    auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
    transient: (bool, optional): Clear the progress on exit. Defaults to False.
    console (Console, optional): Console to write to. Default creates internal Console instance.
    refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
    style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
    complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
    finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
    pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
    disable (bool, optional): Disable display of progress.
Returns:
    ContextManager[BinaryIO]: A context manager yielding a progress reader.

r   r   r   r   r   r   r   r   )r   r   )r   r   r   DownloadColumnr   rC   	wrap_filer'  )r8  r   r   r   r   r   r   r   r   r   r   r   r   r   rB   r)  s   &&$$$$$$$$$$$   rJ   r;  r;  4  s    J EP>	?@UW  NN--'	 !		
 	!  	
  .33 H {KF))rM   r   c          '         V ^8  d   QhR\         \        R\        3,          R\         \        R,          \        R,          3,          R\        R\
        \        ,          R\
        \        ,          R	\
        \        ,          R
\
        \        ,          R\        R\        R\
        \        ,          R\        R\
        \        . \        3,          ,          R\        R\        R\        R\        R\        R\        R\        \        ,          /# )rA   r8  PathLike[str]r   rtr	bufferingencodingerrorsnewliner   r   r   r   r   r   r   r   r   r   r   r   rY   )r&   r   r   r'   r   r    r   r,   r   rG   r6   r   r"   )rH   s   "rJ   rK   rK   v  s    	 	
_e+
,	
ws|+
,	 	 sm		
 SM	 c]	 C=	 	 	 g	 	 xE	*+	 	 	  !	" #	$ %	& '	( F)	rM   c                    R # rg   rZ   r8  r   r@  rA  rB  rC  r   r   r   r   r   r   r   r   r   r   r   r   s   &&&&&&$$$$$$$$$$$$rJ   openrF  u      , 	rM   c          '         V ^8  d   QhR\         \        R\        3,          R\        R,          R\        R\
        \        ,          R\
        \        ,          R\
        \        ,          R	\
        \        ,          R
\        R\        R\
        \        ,          R\        R\
        \        . \        3,          ,          R\        R\        R\        R\        R\        R\        R\        \        ,          /# )rA   r8  r=  r   rbr@  rA  rB  rC  r   r   r   r   r   r   r   r   r   r   r   r   rY   )r&   r   r   r'   r   r    r   r,   r   rG   r6   r   r   )rH   s   "rJ   rK   rK     s     	 	
_e+
,	
$-	 	 sm		
 SM	 c]	 C=	 	 	 g	 	 xE	*+	 	 	  !	" #	$ %	& '	( H)	rM   c                    R # rg   rZ   rE  s   &&&&&&$$$$$$$$$$$$rJ   rF  rF    rG  rM   c          )      b   V ^8  d   QhR\         \        R\        3,          R\         \        R,          \        R,          \        R,          3,          R\        R\
        \        ,          R	\
        \        ,          R
\
        \        ,          R\
        \        ,          R\        R\        R\
        \        ,          R\        R\
        \        . \        3,          ,          R\        R\        R\        R\        R\        R\        R\         \        \        ,          \        \        ,          3,          /# )rA   r8  r=  r   rI  r>  r?  r@  rA  rB  rC  r   r   r   r   r   r   r   r   r   r   r   r   rY   )r&   r   r   r'   r   r    r   r,   r   rG   r6   r   r   r"   )rH   s   "rJ   rK   rK     s6    S* S*
_e+
,S*
wt}gcl:
;S* S* sm	S*
 SMS* c]S* C=S* S* S* gS* S* xE	*+S* S* S*  !S*" #S*$ %S*& 'S*( >(#^F%;;<)S*rM   c                  V'       d   \        R4      .M. pVP                  \        VVVVR7      \        4       \	        4       34       \        TRTRT	RT
RTRT;'       g    ^
RV/ pVP                  V VVVVVVVR	7      p\        VV4      # )
aV  Read bytes from a file while tracking progress.

Args:
    path (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode.
    mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt".
    buffering (int): The buffering strategy to use, see :func:`io.open`.
    encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`.
    errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`.
    newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open`
    total: (int, optional): Total number of bytes to read. Must be provided if reading from a file handle. Default for a path is os.stat(file).st_size.
    description (str, optional): Description of task show next to progress bar. Defaults to "Reading".
    auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
    transient: (bool, optional): Clear the progress on exit. Defaults to False.
    console (Console, optional): Console to write to. Default creates internal Console instance.
    refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
    style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
    complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
    finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
    pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
    disable (bool, optional): Disable display of progress.
    encoding (str, optional): The encoding to use when reading in text mode.

Returns:
    ContextManager[BinaryIO]: A context manager yielding a progress reader.

r   r   r   r   r   r   r   r   )r   r@  rA  rB  rC  r   r   )r   r   r   r:  r   rC   rF  r'  )r8  r   r@  rA  rB  rC  r   r   r   r   r   r   r   r   r   r   r   r   r   rB   r)  s   &&&&&&$$$$$$$$$$$$   rJ   rF  rF    s    b EP>	?@UW  NN--'	 !		
 	!  	
  .33 H ]]  	F &))rM   c                      a  ] tR tRt o RtRtRV 3R lR lltV 3R lR ltV 3R lR	 lt]	V 3R
 lR l4       t
V 3R ltRtV tR# )ProgressColumni  z3Base class for a widget to use in progress display.Nc                4   < V ^8  d   QhRS[ S[,          RR/# )rA   table_columnrY   N)r    r7   )rH   rI   s   "rJ   rK   ProgressColumn.__annotate__  s      2 2Xf%5 2 2rM   c                .    Wn         / V n        R V n        R # rg   )_table_column_renderable_cache_update_time)rT   rP  s   &&rJ   rS   ProgressColumn.__init__  s    )MO-1rM   c                    < V ^8  d   QhRS[ /# r   )r7   )rH   rI   s   "rJ   rK   rQ    s     . .& .rM   c                >    V P                   ;'       g    \        4       # )z.Get a table column, used to build tasks table.)rS  r7   rj   s   &rJ   get_table_columnProgressColumn.get_table_column  s    !!--VX-rM   c                $   < V ^8  d   QhRRRS[ /# rA   r   TaskrY   r/   )rH   rI   s   "rJ   rK   rQ    s      V  rM   c                R   VP                  4       pV P                  eM   VP                  '       g;    V P                  VP                  ,          w  r4W0P                  ,           V8  d   V#  V P                  V4      pW$3V P                  VP                  &   V#   \
         d     L:i ; i)zCalled by the Progress object to return a renderable for the given task.

Args:
    task (Task): An object containing information regarding the task.

Returns:
    RenderableType: Anything renderable (including str).
)r   max_refreshrQ   rT  idKeyErrorrender)rT   r   current_time	timestamp
renderables   &&   rJ   __call__ProgressColumn.__call__  s     }}'&(,(>(>tww(G%	 ///,>%% ? [[&
+7*Dtww'  s   B B&%B&c                $   < V ^8  d   QhRRRS[ /# r\  r^  )rH   rI   s   "rJ   rK   rQ  #  s     1 16 1n 1rM   c                    R# )z"Should return a renderable object.NrZ   rT   r   s   &&rJ   rc  ProgressColumn.render"  s    rM   c                6   < V ^8  d   Qh/ S[ S[,          ;R&   # )rA   r`  r    rG   )rH   rI   s   "rJ   rK   rQ    s      %' rM   )rT  rS  rU  rg   )r{   r|   r}   r~   r   r`  rS   rY  rg  r   rc  __annotate_func__r   r   r%  s   @rJ   rN  rN    sG     =#'K2 2
. . . 1 1M  rM   rN  c                   `   a a ] tR tRt oRtR
RR/V3R lV 3R lllltV3R lR ltR	tVtV ;t	# )RenderableColumni'  zA column to insert an arbitrary column.

Args:
    renderable (RenderableType, optional): Any renderable. Defaults to empty string.
rP  Nc                6   < V ^8  d   QhRS[ RS[S[,          /# )rA   rf  rP  )r/   r    r7   )rH   rI   s   "rJ   rK   RenderableColumn.__annotate__.  s"     4 4(4@H@P4rM   c               4   < Wn         \        SV `	  VR 7       R# rP  N)rf  rR   rS   )rT   rf  rP  rU   s   &&$rJ   rS   RenderableColumn.__init__.  s     %l3rM   c                $   < V ^8  d   QhRRRS[ /# r\  r^  )rH   rI   s   "rJ   rK   rs  4  s      6 n rM   c                    V P                   # rg   rf  rk  s   &&rJ   rc  RenderableColumn.render4  s    rM   rz  ) 
r{   r|   r}   r~   r   rS   rc  r   r   r   r   s   @@rJ   rq  rq  '  s+     4SW4 4  rM   rq  c                   n   a a ] tR tRt oRtR
V3R lV 3R llltRV3R lR lltV3R lR ltR	tVt	V ;t
# )SpinnerColumni8  aq  A column with a 'spinner' animation.

Args:
    spinner_name (str, optional): Name of spinner animation. Defaults to "dots".
    style (StyleType, optional): Style of spinner. Defaults to "progress.spinner".
    speed (float, optional): Speed factor of spinner. Defaults to 1.0.
    finished_text (TextType, optional): Text used when task is finished. Defaults to " ".
c                X   < V ^8  d   QhRS[ RS[S[,          RS[RS[RS[S[,          /# )rA   spinner_namer   speedfinished_textrP  )r   r    r6   rG   r:   r7   )rH   rI   s   "rJ   rK   SpinnerColumn.__annotate__B  sG     4 44 	"4 	4
  4 v&4rM   c                   < \        WVR 7      V n        \        V\        4      '       d   \        P
                  ! V4      MTV n        \        SV `!  VR7       R# )r   r  rv  N)	r5   spinner
isinstancer   r9   from_markupr  rR   rS   )rT   r  r   r  r  rP  rU   s   &&&&&&rJ   rS   SpinnerColumn.__init__B  sO     |F --- ]+ 	
 	l3rM   c                @   < V ^8  d   QhRS[ RS[S[,          RS[RR/# )rA   r  spinner_styler  rY   N)r   r    r6   rG   )rH   rI   s   "rJ   rK   r  R  s>     O OO  	*O 	O
 
OrM   c                *    \        WVR7      V n        R# )a  Set a new spinner.

Args:
    spinner_name (str): Spinner name, see python -m rich.spinner.
    spinner_style (Optional[StyleType], optional): Spinner style. Defaults to "progress.spinner".
    speed (float, optional): Speed factor of spinner. Defaults to 1.0.
r  N)r5   r  )rT   r  r  r  s   &&&&rJ   set_spinnerSpinnerColumn.set_spinnerR  s     |NrM   c                $   < V ^8  d   QhRRRS[ /# r\  r^  )rH   rI   s   "rJ   rK   r  a  s      6 n rM   c                    VP                   '       d   V P                  pV# V P                  P                  VP	                  4       4      pV# rg   )finishedr  r  rc  r   )rT   r   texts   && rJ   rc  SpinnerColumn.rendera  sJ     }}}  	
  $$T]]_5 	
 rM   )r  r  )dotsprogress.spinner      ? N)r  r  )r{   r|   r}   r~   r   rS   r  rc  r   r   r   r   s   @@rJ   r  r  8  s/     4 4 O O  rM   r  c                   X   a a ] tR tRt oRtRV3R lV 3R llltV3R lR ltRtVtV ;t	# )	r   ij  zA column containing text.c                b   < V ^8  d   QhRS[ RS[RS[RS[RS[S[,          RS[S[,          RR/# )	rA   text_formatr   justifymarkuphighlighterrP  rY   Nr   r6   r.   r   r    r0   r7   )rH   rI   s   "rJ   rK   TextColumn.__annotate__m  sd     L LL L 	L
 L k*L v&L 
LrM   c                   < Wn         W0n        W n        W@n        WPn        \
        ST `  T;'       g    \        R R7      R7       R# )Tno_wraprv  N)r  r  r   r  r  rR   rS   r7   )rT   r  r   r  r  r  rP  rU   s   &&&&&&&rJ   rS   TextColumn.__init__m  s=     '&-
&l&J&JfT6JKrM   c                $   < V ^8  d   QhRRRS[ /# r\  r9   )rH   rI   s   "rJ   rK   r  }  s      6 d rM   c                X   V P                   P                  VR 7      pV P                  '       d.   \        P                  ! W P
                  V P                  R7      pM!\        W P
                  V P                  R7      pV P                  '       d   V P                  P                  V4       V# )r   r   r  )	r  rH   r  r9   r  r   r  r  	highlight)rT   r   _textr  s   &&  rJ   rc  TextColumn.render}  sw      ''T'2;;;##ET\\RDZZFD&&t,rM   )r  r  r  r   r  )noneleftTNNr}  r   s   @@rJ   r   r   j  s#     #L L   rM   r   c                   X   a a ] tR tRt oRtRV3R lV 3R llltV3R lR ltRtVtV ;t	# )	r   i  a  Renders a visual progress bar.

Args:
    bar_width (Optional[int], optional): Width of bar or None for full width. Defaults to 40.
    style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
    complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
    finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
    pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
c                b   < V ^8  d   QhRS[ S[,          RS[RS[RS[RS[RS[ S[,          RR/# )	rA   	bar_widthr   r   r   r   rP  rY   N)r    r   r6   r7   )rH   rI   s   "rJ   rK   BarColumn.__annotate__  sZ     4 4C=4 4 "	4
 "4 4 v&4 
4rM   c                d   < Wn         W n        W0n        W@n        WPn        \
        SV `  VR 7       R# ru  )r  r   r   r   r   rR   rS   )rT   r  r   r   r   r   rP  rU   s   &&&&&&&rJ   rS   BarColumn.__init__  s1     #
,,&l3rM   c                $   < V ^8  d   QhRRRS[ /# r\  r3   )rH   rI   s   "rJ   rK   r    s     
 
6 
k 
rM   c                l   \        VP                  e   \        ^ VP                  4      MR\        ^ VP                  4      V P                  f   RM\        ^V P                  4      VP
                  '       * VP                  4       V P                  V P                  V P                  V P                  R7	      # )z&Gets a progress bar widget for a task.N)	r   rQ   widthpulseanimation_timer   r   r   r   )r4   r   maxrQ   r  startedr   r   r   r   r   rk  s   &&rJ   rc  BarColumn.render  s    (,

(>#a$D!T^^,..0$c!T^^6Lll"==?**....((

 
	
rM   )r  r   r   r   r   )(   r   r   r   r   Nr}  r   s   @@rJ   r   r     s#     4 4 
 
 
rM   r   c                   6   a  ] tR tRt o RtV 3R lR ltRtV tR# )TimeElapsedColumni  zRenders time elapsed.c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK   TimeElapsedColumn.__annotate__  s     : :6 :d :rM   c                    VP                   '       d   VP                  MVP                  pVf   \        RRR7      # \	        \        ^ \        V4      4      R7      p\        \        V4      RR7      # )zShow time elapsed.-:--:--progress.elapsedr   )seconds)r  finished_timeelapsedr9   r	   r  r   r   )rT   r   r  deltas   &&  rJ   rc  TimeElapsedColumn.render  sU    (,$$$4<<?	);<<#aW"67CJ&899rM   rZ   Nr{   r|   r}   r~   r   rc  r   r   r%  s   @rJ   r  r    s     : :rM   r  c                   t   a a ] tR tRt oRtR
V3R lV 3R lllt]V3R lR l4       tV3R lR ltR	t	Vt
V ;t# )r   i  a  Show task progress as a percentage.

Args:
    text_format (str, optional): Format for percentage display. Defaults to "[progress.percentage]{task.percentage:>3.0f}%".
    text_format_no_percentage (str, optional): Format if percentage is unknown. Defaults to "".
    style (StyleType, optional): Style of output. Defaults to "none".
    justify (JustifyMethod, optional): Text justification. Defaults to "left".
    markup (bool, optional): Enable markup. Defaults to True.
    highlighter (Optional[Highlighter], optional): Highlighter to apply to output. Defaults to None.
    table_column (Optional[Column], optional): Table Column to use. Defaults to None.
    show_speed (bool, optional): Show speed if total is unknown. Defaults to False.
c                n   < V ^8  d   QhRS[ RS[ RS[RS[RS[RS[S[,          RS[S[,          RS[R	R
/	# )rA   r  text_format_no_percentager   r  r  r  rP  r   rY   Nr  )rH   rI   s   "rJ   rK   TaskProgressColumn.__annotate__  so     
 

 $'
 	

 
 
 k*
 v&
 
 

rM   c	           	     J   < W n         Wn        \        S	V `  VVVVVVR 7       R# ))r  r   r  r  r  rP  N)r  r   rR   rS   )
rT   r  r  r   r  r  r  rP  r   rU   s
   &&&&&&&&&rJ   rS   TaskProgressColumn.__init__  s5     *C&$##% 	 	
rM   c                6   < V ^8  d   QhRS[ S[,          RS[/# )rA   r  rY   )r    rG   r9   )rH   rI   s   "rJ   rK   r    s#     S S% ST SrM   c                    Vf   \        RRR7      # \        P                  ! \        V4      . ROR4      w  r#W,          p\        VR V R2RR7      # )zRender the speed in iterations per second.

Args:
    task (Task): A Task object.

Returns:
    Text: Text object containing the task speed.
r|  zprogress.percentager    z.1fz it/s)r|  u   ×10³u   ×10⁶u   ×10⁹u   ×10¹²)r9   r*   pick_unit_and_suffixr   )clsr  unitsuffix
data_speeds   &&   rJ   render_speedTaskProgressColumn.render_speed  s[     ="78844J<

 \
z#&vhe4<QRRrM   c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK   r    s      6 d rM   c                .   VP                   fB   V P                  '       d0   T P                  VP                  ;'       g    VP                  4      # VP                   f   V P
                  MV P                  pVP                  VR7      pV P                  '       d.   \        P                  ! W0P                  V P                  R7      pM!\        W0P                  V P                  R7      pV P                  '       d   V P                  P                  V4       V# )Nr  r  )r   r   r  finished_speedr  r  r  rH   r  r9   r  r   r  r  r  )rT   r   r  r  r  s   &&   rJ   rc  TaskProgressColumn.render  s    ::$///$$T%8%8%F%FDJJGG.2jj.@D**dFVFV 	 """-;;;##ET\\RDZZFD&&t,rM   )r   r  )z-[progress.percentage]{task.percentage:>3.0f}%r|  r  r  TNNF)r{   r|   r}   r~   r   rS   classmethodr  rc  r   r   r   r   s   @@rJ   r   r     s9     
 
, S S&  rM   r   c                   \   a a ] tR tRt oRtRtR	V3R lV 3R llltV3R lR ltRtVt	V ;t
# )
r   i  zRenders estimated time remaining.

Args:
    compact (bool, optional): Render MM:SS when time remaining is less than an hour. Defaults to False.
    elapsed_when_finished (bool, optional): Render time elapsed when the task is finished. Defaults to False.
      ?c                <   < V ^8  d   QhRS[ RS[ RS[S[,          /# )rA   compactr   rP  r   r    r7   )rH   rI   s   "rJ   rK    TimeRemainingColumn.__annotate__  s.     4 44  $4 v&	4rM   c                @   < Wn         W n        \        SV `  VR 7       R# ru  )r  r   rR   rS   )rT   r  r   rP  rU   s   &&&&rJ   rS   TimeRemainingColumn.__init__  s      %:"l3rM   c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK   r    s     , ,6 ,d ,rM   c                   V P                   '       d"   VP                  '       d   VP                  pRpMVP                  pRpVP                  f   \        RVR7      # Vf(   \        V P                  '       d	   RVR7      # RVR7      # \        \        V4      ^<4      w  rE\        V^<4      w  rdV P                  '       d   V'       g   VR RVR 2pMVR	 RVR RVR 2p\        WsR7      # )
zShow time remaining.r  zprogress.remainingr|  r  z--:--r  02d:d)	r   r  r  time_remainingr   r9   r  divmodr   )rT   r   	task_timer   minutesr  hours	formatteds   &&      rJ   rc  TimeRemainingColumn.render  s    %%%$---**I&E++I(E::%((4<<<eLLYeLL "#i."5,<<<"3-q6I )1WSM73-@II++rM   )r  r   )FFN)r{   r|   r}   r~   r   r`  rS   rc  r   r   r   r   s   @@rJ   r   r     s*      K4 4, , ,rM   r   c                   6   a  ] tR tRt o RtV 3R lR ltRtV tR# )FileSizeColumni6  zRenders completed filesize.c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK   FileSizeColumn.__annotate__9  s     : :6 :d :rM   c                n    \         P                  ! \        VP                  4      4      p\	        VRR7      # )Show data completed.zprogress.filesizer  )r*   decimalr   rQ   r9   rT   r   	data_sizes   && rJ   rc  FileSizeColumn.render9  s)    $$S%89	I%899rM   rZ   Nr  r%  s   @rJ   r  r  6  s     %: :rM   r  c                   6   a  ] tR tRt o RtV 3R lR ltRtV tR# )TotalFileSizeColumni?  zRenders total filesize.c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK    TotalFileSizeColumn.__annotate__B  s     @ @6 @d @rM   c                    VP                   e*   \        P                  ! \        VP                   4      4      MRp\	        VRR7      # )r  r|  zprogress.filesize.totalr  )r   r*   r  r   r9   r  s   && rJ   rc  TotalFileSizeColumn.renderB  s4    9=9OH$$S_5UW	I%>??rM   rZ   Nr  r%  s   @rJ   r   r   ?  s     !@ @rM   r   c                   X   a a ] tR tRt oRtRV3R lV 3R llltV3R lR ltRtVtV ;t	# )	MofNCompleteColumniH  a0  Renders completed count/total, e.g. '  10/1000'.

Best for bounded tasks with int quantities.

Space pads the completed count so that progress length does not change as task progresses
past powers of 10.

Args:
    separator (str, optional): Text to separate completed and total values. Defaults to "/".
c                6   < V ^8  d   QhRS[ RS[S[,          /# )rA   	separatorrP  )r   r    r7   )rH   rI   s   "rJ   rK   MofNCompleteColumn.__annotate__T  s      4 4# 48F;K 4rM   c                4   < Wn         \        SV `	  VR 7       R# ru  )r  rR   rS   )rT   r  rP  rU   s   &&&rJ   rS   MofNCompleteColumn.__init__T  s    "l3rM   c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK   r	  X  s     
 
6 
d 
rM   c                    \        VP                  4      pVP                  e   \        VP                  4      MRp\        \	        V4      4      p\        W$ R2 V P                   V 2RR7      # )zShow completed/total.?r  progress.downloadr  )r   rQ   r   r   r   r9   r  )rT   r   rQ   r   total_widths   &&   rJ   rc  MofNCompleteColumn.renderX  sa    '	#'::#9DJJs#e*oa((8@%
 	
rM   )r  )/Nr}  r   s   @@rJ   r  r  H  s#     	4 4
 
 
rM   r  c                   X   a a ] tR tRt oRtRV3R lV 3R llltV3R lR ltRtVtV ;t	# )	r:  ic  zRenders file size downloaded and total, e.g. '0.5/2.3 GB'.

Args:
    binary_units (bool, optional): Use binary units, KiB, MiB etc. Defaults to False.
c                :   < V ^8  d   QhRS[ RS[S[,          RR/# )rA   binary_unitsrP  rY   Nr  )rH   rI   s   "rJ   rK   DownloadColumn.__annotate__j  s*     4 4 48@8H4	4rM   c                4   < Wn         \        SV `	  VR 7       R# ru  )r  rR   rS   )rT   r  rP  rU   s   &&&rJ   rS   DownloadColumn.__init__j  s     )l3rM   c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK   r  p  s     ! !6 !d !rM   c                   \        VP                  4      pVP                  e   \        VP                  4      MTpV P                  '       d   \        P
                  ! V. R
OR4      w  rEM\        P
                  ! V. ROR4      w  rEV^8X  d   ^ M^pW$,          pVRV R2 pVP                  e'   \        VP                  4      p	W,          p
V
RV R2 pMRpV RV RV 2p\        VRR	7      pV# )z.Calculate common unit for completed and total.i   r  z,.fr  r  r  r  r  )	r   KiBMiBGiBTiBPiBEiBZiBYiB)	r   kBMBGBTBPBEBZBYB)r   rQ   r   r  r*   r  r9   )rT   r   rQ    unit_and_suffix_calculation_baser  r  	precisioncompleted_ratiocompleted_strr   total_ratio	total_strdownload_statusdownload_texts   &&            rJ   rc  DownloadColumn.renderp  s    '	  $zz5C

O9 	) #880QLD& $880ILD
 A	#**2i[/:::!

OE,K&r)Ao6II*O1YKqA_4GHrM   )r  r   r}  r   s   @@rJ   r:  r:  c  s#     4 4! ! !rM   r:  c                   6   a  ] tR tRt o RtV 3R lR ltRtV tR# )TransferSpeedColumni  z&Renders human readable transfer speed.c                $   < V ^8  d   QhRRRS[ /# r\  r  )rH   rI   s   "rJ   rK    TransferSpeedColumn.__annotate__  s     D D6 Dd DrM   c                    VP                   ;'       g    VP                  pVf   \        RRR7      # \        P                  ! \        V4      4      p\        V R2RR7      # )zShow data transfer speed.r  zprogress.data.speedr  z/s)r  r  r9   r*   r  r   )rT   r   r  r  s   &&  rJ   rc  TransferSpeedColumn.render  sU    ##11tzz=#899%%c%j1
zl"%-BCCrM   rZ   Nr  r%  s   @rJ   r6  r6    s     0D DrM   r6  c                   4   a  ] tR tRt o Rt  V 3R ltRtV tR# )ProgressSamplei  z$Sample of progress for a given time.c                2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )rA   re  rQ   rF   )rH   rI   s   "rJ   rK   ProgressSample.__annotate__  s       
  rM   rZ   N)r{   r|   r}   r~   r   ro  r   r   r%  s   @rJ   r<  r<    s     . $  rM   r<  c                     a  ] tR tRt o Rt     Rt Rt ]! ]R7      t	 ]! RRRR7      t
 ]! RRRR7      t Rt ]! R RRR	7      t]! R]R
7      t V 3R lR lt]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R ltRtV tR# )r]  i  z}Information regarding a progress task.

This object should be considered read-only outside of the :class:`~Progress` class.

NT)default_factoryF)defaultinitreprc                     \        R R7      # )r  )maxlenr   rZ   rM   rJ   <lambda>Task.<lambda>  s	    T 2rM   )r@  rB  rC  )rC  r@  c                    < V ^8  d   QhRS[ /# r   rF   )rH   rI   s   "rJ   rK   Task.__annotate__  s        %  rM   c                "    V P                  4       # )z(float: Get the current time, in seconds.)	_get_timerj   s   &rJ   r   Task.get_time  s    ~~rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   rI    s     + + +rM   c                    V P                   RJ# )z#bool: Check if the task as started.N)
start_timerj   s   &rJ   r  Task.started  s     d**rM   c                0   < V ^8  d   QhRS[ S[,          /# r   rn  )rH   rI   s   "rJ   rK   rI    s     + +8E? +rM   c                \    V P                   f   R# V P                   V P                  ,
          # )zPOptional[float]: Get the number of steps remaining, if a non-None total was set.Nr   rQ   rj   s   &rJ   	remainingTask.remaining  s$     ::zzDNN**rM   c                0   < V ^8  d   QhRS[ S[,          /# r   rn  )rH   rI   s   "rJ   rK   rI    s     1 1% 1rM   c                    V P                   f   R# V P                  e   V P                  V P                   ,
          # V P                  4       V P                   ,
          # )z]Optional[float]: Time elapsed since task was started, or ``None`` if the task hasn't started.N)rO  	stop_timer   rj   s   &rJ   r  Task.elapsed  sC     ??">>%>>DOO33}}00rM   c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   rI    s     . .$ .rM   c                    V P                   RJ# )zCheck if the task has finished.N)r  rj   s   &rJ   r  Task.finished  s     !!--rM   c                    < V ^8  d   QhRS[ /# r   rF   )rH   rI   s   "rJ   rK   rI    s      E rM   c                    V P                   '       g   R# V P                  V P                   ,          R,          p\        R\        RV4      4      pV# )zOfloat: Get progress of task as a percentage. If a None total was set, returns 0              Y@)r   rQ   minr  )rT   rQ   s   & rJ   
percentageTask.percentage  s@     zzz^^djj0E9	s3	23	rM   c                0   < V ^8  d   QhRS[ S[,          /# r   rn  )rH   rI   s   "rJ   rK   rI    s      x rM   c                   V P                   f   R# V P                  ;_uu_ 4        V P                  pV'       g    RRR4       R# VR,          P                  V^ ,          P                  ,
          pV^ 8X  d    RRR4       R# \	        V4      p\        V4       \        R V 4       4      pWB,          pVuuRRR4       #   + '       g   i     R# ; i)z=Optional[float]: Get the estimated speed in steps per second.Nc              3   8   "   T F  qP                   x  K  	  R # 5irg   r  ).0samples   & rJ   	<genexpr>Task.speed.<locals>.<genexpr>  s     !Ov"2"2   r#  )rO  _lock	_progressre  iterr   r  )rT   rB   
total_timeiter_progresstotal_completedr  s   &     rJ   r  
Task.speed   s     ??"ZZZ~~H Z ""//(1+2G2GGJQ Z !NM!!O!OOO#0E ZZZs   B>3B>1B>>C	c                0   < V ^8  d   QhRS[ S[,          /# r   rn  )rH   rI   s   "rJ   rK   rI    s       rM   c                    V P                   '       d   R# V P                  pV'       g   R# V P                  pVf   R# \        W!,          4      pV# )zJOptional[float]: Get estimated time to completion, or ``None`` if no data.r_  N)r  r  rT  r   )rT   r  rT  estimates   &   rJ   r  Task.time_remaining  sC     ===

NN		)*rM   c                   < V ^8  d   QhRR/# rX   rZ   )rH   rI   s   "rJ   rK   rI     s     # # #rM   c                V    V P                   P                  4        RV n        RV n        R# )zReset progress.N)rm  clearr  r  rj   s   &rJ   _resetTask._reset   s"    !"rM   c                ,  < V ^8  d   Qh/ S[ ;R&   S[;R&   S[S[,          ;R&   S[;R&   S[;R&   S[S[,          ;R&   S[;R&   S[S[S[3,          ;R&   S[S[,          ;R	&   S[S[,          ;R
&   S[S[,          ;R&   S[S[	,          ;R&   S[
;R&   # )rA   ra  r   r   rQ   rK  r  visiblefieldsrO  rX  r  rm  rl  )r;   r   r    rG   GetTimeCallabler   r   r   r   r<  r   )rH   rI   s   "rJ   rK   rI    s      	J    E? " # ( ) . E?)/ 4 5 : cN8; @ MA F LG L UO*M R ^$ S Z ;[ rM   )r  r  )r{   r|   r}   r~   r   r  r}  r   dictr~  rO  rX  r  rm  r   rl  r   r$  r  rT  r  r  rb  r  r  rz  ro  r   r   r%  s   @rJ   r]  r]    s5     H ( ? + ,%)M(GJ"48F?"'5u"MJN!&t%e!LIN&*N>',2U(I eU;E    + + + + 1 1 . .    "  # #o  rM   r]  c                   0  a  ] tR tRt o RtRRRRR^
RR	R
RRRRRRRRRRR/
V 3R lR llt]V 3R lR l4       t]V 3R lR l4       t	]V 3R lR l4       t
]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R lR  ltV 3R! lR" ltV 3R# lR$ ltRQV 3R% lR& lltRRR'RR(R)/V 3R* lR+ lllt]P(                  RSR,RR'RR(R)/V 3R- lR. lll4       t]P(                  RSR,RR'RR(R)/V 3R/ lR0 lll4       tRTR,RR'RR(R)/V 3R1 lR2 llltV 3R3 lR4 ltV 3R5 lR6 ltR,RR7RR8RR(RR9RR:R/V 3R; lR< lltR=RR,RR7^ R9RR(R/V 3R> lR? lltRUV 3R@ lRA lltV 3RB lRC ltV 3RD lRE ltV 3RF lRG ltV 3RH lRI ltV 3RJ lRK ltRVV 3RL lRM llt V 3RN lRO lt!RPt"V t#R# )WrC   i'  a\  Renders an auto-updating progress bar(s).

Args:
    console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout.
    auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()`.
    refresh_per_second (Optional[float], optional): Number of times per second to refresh the progress information or None to use default (10). Defaults to None.
    speed_estimate_period: (float, optional): Period (in seconds) used to calculate the speed estimate. Defaults to 30.
    transient: (bool, optional): Clear the progress on exit. Defaults to False.
    redirect_stdout: (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True.
    redirect_stderr: (bool, optional): Enable redirection of stderr. Defaults to True.
    get_time: (Callable, optional): A callable that gets the current time, or None to use Console.get_time. Defaults to None.
    disable (bool, optional): Disable progress display. Defaults to False
    expand (bool, optional): Expand tasks table to fit width. Defaults to False.
r   Nr   Tr   speed_estimate_periodg      >@r   Fredirect_stdoutredirect_stderrr   r   expandc                   < V ^8  d   QhRS[ S[S[3,          RS[S[,          RS[RS[RS[RS[RS[RS[R	S[S[,          R
S[RS[RR/# )rA   r   r   r   r   r  r   r  r  r   r   r  rY   N)r&   r   rN  r    r,   r   rG   r  )rH   rI   s   "rJ   rK   Progress.__annotate__7  s     "$ "$^+,"$ '""$ 	"$
 ""$  %"$ "$ "$ "$ ?+"$ "$ "$ 
"$rM   c       
   
        V^ 8  g   Q R4       h\        4       V n        T;'       g    V P                  4       V n        W@n        Wn        Wn        / V n        \        ^ 4      V n	        \        T;'       g    \        4       VVVVVV P                  R7      V n        T;'       g    V P                  P                  V n        V P                  P                   V n        V P                  P"                  V n        R# )r   zrefresh_per_second must be > 0)r   r   r   r   r  r  get_renderableN)r   rl  get_default_columnsr   r  r   r  _tasksr;   _task_indexr2   r+   r  r_   r   r   printlog)rT   r   r   r   r  r   r  r  r   r   r  r   s   &$$$$$$$$$$*rJ   rS   Progress.__init__7  s     "A%G'GG%W
<<$":":"<%:"*,#)!9,,{}%1++..
	 !99DLL$9$9\\''
<<##rM   c                4   < V ^8  d   QhRS[ S[R3,          /# )rA   rY   .)r#   rN  )rH   rI   s   "rJ   rK   r  \  s     
 
E.#*=$> 
rM   c                P    \        R4      \        4       \        4       \        4       3# )a  Get the default columns used for a new Progress instance:
   - a text column for the description (TextColumn)
   - the bar itself (BarColumn)
   - a text column showing completion percentage (TextColumn)
   - an estimated-time-remaining column (TimeRemainingColumn)
If the Progress instance is created without passing a columns argument,
the default columns defined here will be used.

You can also create a Progress instance using custom columns before
and/or after the defaults, as in this example:

    progress = Progress(
        SpinnerColumn(),
        *Progress.get_default_columns(),
        "Elapsed:",
        TimeElapsedColumn(),
    )

This code shows the creation of a Progress display, containing
a spinner to the left, the default columns, and a labeled elapsed
time column.
r   )r   r   r   r   )r  s   &rJ   r  Progress.get_default_columns[  s(    2 ABK !	
 	
rM   c                    < V ^8  d   QhRS[ /# r   )r,   )rH   rI   s   "rJ   rK   r  {  s     ! ! !rM   c                .    V P                   P                  # rg   )r_   r   rj   s   &rJ   r   Progress.consolez  s    yy   rM   c                0   < V ^8  d   QhRS[ S[,          /# r   )r   r]  )rH   rI   s   "rJ   rK   r    s     . .tDz .rM   c                    V P                   ;_uu_ 4        \        V P                  P                  4       4      uuRRR4       #   + '       g   i     R# ; i)zGet a list of Task instances.N)rl  listr  valuesrj   s   &rJ   tasksProgress.tasks~  s.     ZZZ**,- ZZZ   #AA	c                0   < V ^8  d   QhRS[ S[,          /# r   )r   r;   )rH   rI   s   "rJ   rK   r    s     , ,$v, ,rM   c                    V P                   ;_uu_ 4        \        V P                  P                  4       4      uuRRR4       #   + '       g   i     R# ; i)zA list of task IDs.N)rl  r  r  keysrj   s   &rJ   task_idsProgress.task_ids  s.     ZZZ((*+ ZZZr  c                    < V ^8  d   QhRS[ /# r   r   )rH   rI   s   "rJ   rK   r    s     G G$ GrM   c                j   V P                   ;_uu_ 4        V P                  '       g    RRR4       R# \        ;QJ d4    R V P                  P                  4        4       F  '       d   K   RM)	  RM%! R V P                  P                  4        4       4      uuRRR4       #   + '       g   i     R# ; i)z'Check if all tasks have been completed.NTc              3   8   "   T F  qP                   x  K  	  R # 5irg   )r  )rg  r   s   & rJ   ri  $Progress.finished.<locals>.<genexpr>  s     F1E}}1Erk  F)rl  r  allr  rj   s   &rJ   r  Progress.finished  sf     ZZZ;;; Z 3F1C1C1EF333F1C1C1EFF ZZZs   B!
B!)B!*,B!!B2	c                   < V ^8  d   QhRR/# rX   rZ   )rH   rI   s   "rJ   rK   r    s     * *t *rM   c                f    V P                   '       g   V P                  P                  RR7       R# R# )zStart the progress display.T)r\   N)r   r_   ri   rj   s   &rJ   ri   Progress.start  s"    |||IIOODO) rM   c                   < V ^8  d   QhRR/# rX   rZ   )rH   rI   s   "rJ   rK   r    s     ! !d !rM   c                    V P                   P                  4        V P                  P                  '       g;   V P                  P                  '       g   V P                  P                  4        R# R# R# )zStop the progress display.N)r_   r4  r   is_interactive
is_jupyterr  rj   s   &rJ   r4  Progress.stop  sH    		||***4<<3J3J3JLL  4K*rM   c                    < V ^8  d   QhRS[ /# r   r(   )rH   rI   s   "rJ   rK   r    s      4 rM   c                &    V P                  4        V # rg   rh   rj   s   &rJ   rk   Progress.__enter__  rm   rM   c                p   < V ^8  d   QhRS[ S[S[,          ,          RS[ S[,          RS[ S[,          RR/# ro   rs   )rH   rI   s   "rJ   rK   r    sG      4./ -( '	
 
rM   c                &    V P                  4        R # rg   )r4  rx   s   &&&&rJ   ry   Progress.__exit__  s     			rM   c                   < V ^8  d   QhRS[ S[S[,          S[S[,          3,          RS[S[,          RS[RS[S[,          RS[RS[RS[S[,          /# )rA   r   r   rQ   rD   r   rE   rY   )	r&   r   r<   r!   r    rG   r   r;   r   )rH   rI   s   "rJ   rK   r    ss     ) ).0FFG) ) 	)
 &!) ) ) 
,	)rM   c              #    "   Vf   \        \        V4      4      ;'       g    RpVf   V P                  WRVR7      pMV P                  WBVR7       V P                  P
                  '       dF   \        WV4      ;_uu_ 4       pV F   pVx  V;P                  ^,          un        K"  	  RRR4       R# V P                  p	V P                  p
V F  pVx  V	! V^4       V
! 4        K  	  R#   + '       g   i     R# ; i5i)a  Track progress by iterating over a sequence.

Args:
    sequence (Sequence[ProgressType]): A sequence of values you want to iterate over and track progress.
    total: (float, optional): Total number of steps. Default is len(sequence).
    completed (int, optional): Number of steps completed so far. Defaults to 0.
    task_id: (TaskID): Task to track. Default is new task.
    description: (str, optional): Description of task, if new task is created.
    update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1.

Returns:
    Iterable[ProgressType]: An iterable of values taken from the provided sequence.
NrS  )
rG   r   add_taskra   r_   r   r?   rQ   r]   r\   )rT   r   r   rQ   rD   r   rE   track_threadvaluer]   r\   s   &&&&&&&    rJ   r   Progress.track  s     , =+h/088DE?mmK	mRGKK	KB99!!!d];;|%EK **a/* & <;
 llGllG!#	 " <;;s*   C<A	C<,C< 'C('AC<(C9	3	C<rD   r   r6  c          
      X   < V ^8  d   QhRS[ RS[S[,          RS[S[,          RS[RS[ /# )rA   r8  r   rD   r   rY   )r   r    r   r;   r   )rH   rI   s   "rJ   rK   r    sM     (@ (@(@ }(@
 &!(@ (@ 
(@rM   c               B   RpVe   TpM>Ve;   V P                   ;_uu_ 4        V P                  V,          P                  pRRR4       Vf   \        R4      hVf   V P	                  WER7      pMV P                  W5R7       \        WVRR7      #   + '       g   i     LV; i)a  Track progress file reading from a binary file.

Args:
    file (BinaryIO): A file-like object opened in binary mode.
    total (int, optional): Total number of bytes to read. This must be provided unless a task with a total is also given.
    task_id (TaskID): Task to track. Default is new task.
    description (str, optional): Description of task, if new task is created.

Returns:
    BinaryIO: A readable file-like object in binary mode.

Raises:
    ValueError: When no total value can be extracted from the arguments or the task.
Nz?unable to get the total number of bytes, please specify 'total'r   Fr   )rl  r  r   
ValueErrorr  ra   r   )rT   r8  r   rD   r   total_bytess   &&&$$ rJ   r;  Progress.wrap_file  s    . (,K "kk'288 Q 
 ?mmKmCGKKK3t7?? s   BB	r   c                   < V ^8  d   QhRS[ S[RS[3,          RS[R,          RS[RS[S[,          RS[S[,          RS[S[,          R	S[S[,          R
S[S[,          RS[RS[/
# )rA   r8  r=  r   rI  r@  rA  rB  rC  r   rD   r   rY   )r&   r   r   r'   r   r    r;   r   )rH   rI   s   "rJ   rK   r    s      C%/0 dm 	
 3-  # } &!  
rM   c                   R # rg   rZ   
rT   r8  r   r@  rA  rB  rC  r   rD   r   s
   &&&&&&&$$$rJ   rF  Progress.open       	rM   c                   < V ^8  d   QhRS[ S[RS[3,          RS[ S[R,          S[R,          3,          RS[RS[S[,          RS[S[,          R	S[S[,          R
S[S[,          RS[S[,          RS[RS[/
# )rA   r8  r=  r   r?  r>  r@  rA  rB  rC  r   rD   r   rY   )r&   r   r   r'   r   r    r;   r"   )rH   rI   s   "rJ   rK   r    s      C%/0 GCL'$-/0 	
 3-  # } &!  
rM   c                   R # rg   rZ   r  s
   &&&&&&&$$$rJ   rF  r    r  rM   c                  < V ^8  d   QhRS[ S[RS[3,          RS[ S[R,          S[R,          S[R,          3,          RS[RS[S[,          R	S[S[,          R
S[S[,          RS[S[,          RS[S[,          RS[RS[ S[S[3,          /
# )rA   r8  r=  r   rI  r>  r?  r@  rA  rB  rC  r   rD   r   rY   )	r&   r   r   r'   r   r    r;   r   r"   )rH   rI   s   "rJ   rK   r    s     K KC%/0K GDM74='#,>?K 	K
 3-K K #K }K &!K K 
x	 KrM   c               &   RP                  \        VRR7      4      p
V
R9  d   \        RV: 24      hV^8H  pV
R8X  d&   V^8X  d   \        P                  ! R\
        4       RpM"V
R9   d   V^ 8X  d   \        R4      hV^8X  d   RpVf   \        V4      P                  pVf   V P                  WR7      pMV P                  WR7       \        P                  ! VR	VR
7      p\        WVRR7      pVR9   d   \        P                  ! VVVVVR7      # V# )a  Track progress while reading from a binary file.

Args:
    path (Union[str, PathLike[str]]): The path to the file to read.
    mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt".
    buffering (int): The buffering strategy to use, see :func:`io.open`.
    encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`.
    errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`.
    newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open`.
    total (int, optional): Total number of bytes to read. If none given, os.stat(path).st_size is used.
    task_id (TaskID): Task to track. Default is new task.
    description (str, optional): Description of task, if new task is created.

Returns:
    BinaryIO: A readable file-like object in binary mode.

Raises:
    ValueError: When an invalid mode is given.
r|  F)reversebrzinvalid mode zaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be usedzcan't have unbuffered text I/Or  rI  )r@  Tr  )rA  rB  rC  line_buffering)r  r>  r?  r#  )r>  r?  )r?  r>  )rw   sortedr  warningswarnRuntimeWarningr   st_sizer  ra   iorF  r   TextIOWrapper)rT   r8  r   r@  rA  rB  rC  r   rD   r   _moder  r   r)  s   &&&&&&&$$$    rJ   rF  r    s   B tU34))}TH566 #aD=Y!^MMs Ik!A~ !ABBa	 =J&&E ?mmKm=GKKK- ty9wTB ;##!-  rM   c                $   < V ^8  d   QhRS[ RR/# rA   rD   rY   Nr;   )rH   rI   s   "rJ   rK   r  k  s     2 2& 2T 2rM   c                    V P                   ;_uu_ 4        V P                  V,          pVP                  f   V P                  4       Vn        RRR4       R#   + '       g   i     R# ; i)zStart a task.

Starts a task (used when calculating elapsed time). You may need to call this manually,
if you called ``add_task`` with ``start=False``.

Args:
    task_id (TaskID): ID of task.
N)rl  r  rO  r   )rT   rD   r   s   && rJ   
start_taskProgress.start_taskk  s>     ZZZ;;w'D&"&--/ ZZZs   7AA'	c                $   < V ^8  d   QhRS[ RR/# r  r  )rH   rI   s   "rJ   rK   r  y  s     * * *D *rM   c                    V P                   ;_uu_ 4        V P                  V,          pV P                  4       pVP                  f   W2n        W2n        RRR4       R#   + '       g   i     R# ; i)zfStop a task.

This will freeze the elapsed time on the task.

Args:
    task_id (TaskID): ID of task.
N)rl  r  r   rO  rX  )rT   rD   r   rd  s   &&  rJ   	stop_taskProgress.stop_tasky  sF     ZZZ;;w'D==?L&".)N ZZZs   >AA.	rQ   r]   r}  r\   c                   < V ^8  d   QhRS[ RS[S[,          RS[S[,          RS[S[,          RS[S[,          RS[S[,          RS[RS[R	R
/	# )rA   rD   r   rQ   r]   r   r}  r\   r~  rY   N)r;   r    rG   r   r   r   )rH   rI   s   "rJ   rK   r    sy     ; ;; 	;
 E?; %; c]; $; ; ; 
;rM   c                  V P                   ;_uu_ 4        V P                  V,          p	V	P                  p
Ve'   W)P                  8w  d   W)n        V	P	                  4        Ve   V	;P                  V,          un        Ve   W9n        Ve   WYn        Ve   Win        V	P                  P                  V4       V	P                  V
,
          pV P                  4       pWP                  ,
          pV	P                  pVP                  pV'       d"   V^ ,          P                  V8  d
   V! 4        K)  V^ 8  d   VP                  \        W4      4       V	P                  e;   V	P                  V	P                  8  d    V	P                   f   V	P"                  V	n        RRR4       V'       d   V P%                  4        R# R#   + '       g   i     L,; i)aH  Update information associated with a task.

Args:
    task_id (TaskID): Task id (returned by add_task).
    total (float, optional): Updates task.total if not None.
    completed (float, optional): Updates task.completed if not None.
    advance (float, optional): Add a value to task.completed if not None.
    description (str, optional): Change task description if not None.
    visible (bool, optional): Set visible flag if not None.
    refresh (bool): Force a refresh of progress information. Default is False.
    **fields (Any): Additional data fields required for rendering.
N)rl  r  rQ   r   rz  r   r}  r~  ra   r   r  rm  popleftre  appendr<  r  r  r\   )rT   rD   r   rQ   r]   r   r}  r\   r~  r   completed_startupdate_completedrd  old_sample_timerm  r  s   &&$$$$$$,       rJ   ra   Progress.update  sN   0 ZZZ;;w'D"nnO Ujj%8"
"')$!*&#. "&KKv&#~~?==?L*-G-GGOI''G	! 6 6 H	!#  !OP

&NNdjj0&&.%)\\"A D LLN E Zs   C4F8
B
F88G	ri   c                x   < V ^8  d   QhRS[ RS[RS[S[,          RS[RS[S[,          RS[S[,          RS[RR	/# )
rA   rD   ri   r   rQ   r}  r   r~  rY   N)r;   r   r    rG   r   r   r   )rH   rI   s   "rJ   rK   r    sg     % %% 	%
 % % $% c]% % 
%rM   c                  V P                  4       pV P                  ;_uu_ 4        V P                  V,          p	V	P                  4        V'       d   TMRV	n        Ve   W9n        WIn        Ve   WYn        V'       d   Wyn        Ve   Win	        RV	n
        RRR4       V P                  4        R#   + '       g   i     L"; i)a@  Reset a task so completed is 0 and the clock is reset.

Args:
    task_id (TaskID): ID of task.
    start (bool, optional): Start the task after reset. Defaults to True.
    total (float, optional): New total steps in task, or None to use current total. Defaults to None.
    completed (int, optional): Number of steps completed. Defaults to 0.
    visible (bool, optional): Enable display of the task. Defaults to True.
    description (str, optional): Change task description if not None. Defaults to None.
    **fields (str): Additional data fields required for rendering.
N)r   rl  r  rz  rO  r   rQ   r}  r~  r   r  r\   )
rT   rD   ri   r   rQ   r}  r   r~  rd  r   s
   &&$$$$$,  rJ   resetProgress.reset  s    , }}ZZZ;;w'DKKM.3lDO "
&N"&$&#. !%D  	 Zs   AB-<B--B=	c                *   < V ^8  d   QhRS[ RS[RR/# )rA   rD   r]   rY   N)r;   rG   )rH   rI   s   "rJ   rK   r    s"     1 1v 1 1d 1rM   c                   V P                  4       pV P                  ;_uu_ 4        V P                  V,          pVP                  pV;P                  V,          un        VP                  V,
          pW0P                  ,
          pVP
                  pVP                  p	V'       d"   V^ ,          P                  V8  d
   V	! 4        K)  \        V4      R8  d
   V	! 4        K  VP                  \        W64      4       VP                  eL   VP                  VP                  8  d1   VP                  f#   VP                  Vn        VP                  Vn        RRR4       R#   + '       g   i     R# ; i)zAdvance task by a number of steps.

Args:
    task_id (TaskID): ID of task.
    advance (float): Number of steps to advance. Default is 1.
r  N)r   rl  r  rQ   r  rm  r  re  r   r  r<  r   r  r  r  r  )
rT   rD   r]   rd  r   r  r  r  rm  r  s
   &&&       rJ   r]   Progress.advance  s     }}ZZZ;;w'D"nnONNg%N#~~?*-G-GGOI''G	! 6 6 H	i.4'	^LKL

&NNdjj0&&.%)\\"&*jj#) ZZZs   A=E#B-EE+	c                   < V ^8  d   QhRR/# rX   rZ   )rH   rI   s   "rJ   rK   r  
  s          rM   c                    V P                   '       g;   V P                  P                  '       d   V P                  P                  4        R# R# R# )z*Refresh (render) the progress information.N)r   r_   r`   r\   rj   s   &rJ   r\   Progress.refresh
  s1    |||		 4 4 4II !5|rM   c                    < V ^8  d   QhRS[ /# r   r^  )rH   rI   s   "rJ   rK   r    s       rM   c                4    \        V P                  4       !  pV# )z*Get a renderable for the progress display.)r-   get_renderables)rT   rf  s   & rJ   r  Progress.get_renderable  s    D0023
rM   c                0   < V ^8  d   QhRS[ S[,          /# r   )r   r/   )rH   rI   s   "rJ   rK   r    s      .!9 rM   c              #  L   "   V P                  V P                  4      pVx  R# 5i)z5Get a number of renderables for the progress display.N)make_tasks_tabler  )rT   tables   & rJ   r  Progress.get_renderables  s     %%djj1s   "$c                6   < V ^8  d   QhRS[ S[,          RS[/# )rA   r  rY   )r   r]  r8   )rH   rI   s   "rJ   rK   r    s      htn  rM   c                   a R V P                    4       p\        P                  ! VRRRV P                  / pV F;  oSP                  '       g   K  VP
                  ! V3R lV P                    4       !   K=  	  V# )zGet a table to render the Progress display.

Args:
    tasks (Iterable[Task]): An iterable of Task instances, one per row of the table.

Returns:
    Table: A table instance.
c              3      "   T FE  p\        V\        4      '       d   \        R R7      MVP                  4       P	                  4       x  KG  	  R# 5i)Tr  N)r  r   r7   rY  copy)rg  _columns   & rJ   ri  ,Progress.make_tasks_table.<locals>.<genexpr>"  sI      
 ( gs++ t$--/4467 (s   AApaddingr  c              3      <"   T F5  p\        V\        4      '       d   VP                  SR 7      MV! S4      x  K7  	  R# 5i)r  N)r  r   rH   )rg  columnr   s   & rJ   ri  r  /  sB       '3F  *&#66 #MMtM4!'. '3s   =A )r      )r   r8   gridr  r}  add_row)rT   r  table_columnsr  r   s   &&  @rJ   r  Progress.make_tasks_table  so    
  <<
 

MN6N$++ND||| '+ll	  rM   c                    < V ^8  d   QhRS[ /# r   r^  )rH   rI   s   "rJ   rK   r  :  s     ) ). )rM   c                    V P                   ;_uu_ 4        V P                  4       uuRRR4       #   + '       g   i     R# ; i)z+Makes the Progress class itself renderable.N)rl  r  rj   s   &rJ   __rich__Progress.__rich__:  s#    ZZZ&&( ZZZs	   0A	c                T   < V ^8  d   QhRS[ RS[RS[S[,          RS[RS[RS[RS[/# )rA   r   ri   r   rQ   r}  r~  rY   )r   r   r    rG   r   r   r;   )rH   rI   s   "rJ   rK   r  ?  sU     ) )) ) 	)
 ) ) ) 
)rM   c                   V P                   ;_uu_ 4        \        V P                  VVVVVV P                  V P                   R7      pWpP                  V P                  &   V'       d   V P                  V P                  4       V P                  p\        \        V P                  4      ^,           4      V n        RRR4       V P                  4        X#   + '       g   i     L"; i)a  Add a new 'task' to the Progress display.

Args:
    description (str): A description of the task.
    start (bool, optional): Start the task immediately (to calculate elapsed time). If set to False,
        you will need to call `start` manually. Defaults to True.
    total (float, optional): Number of total steps in the progress if known.
        Set to None to render a pulsing animation. Defaults to 100.
    completed (int, optional): Number of steps completed so far. Defaults to 0.
    visible (bool, optional): Enable display of the task. Defaults to True.
    **fields (str): Additional data fields required for rendering.

Returns:
    TaskID: An ID you can use when calling `update`.
)r}  r~  rK  rl  N)	rl  r]  r  r   r  r  r;   r   r\   )	rT   r   ri   r   rQ   r}  r~  r   new_task_indexs	   &&&&&&,  rJ   r  Progress.add_task?  s    0 ZZZ  --jj	D -1KK(() 0 01!--N%c$*:*:&;a&?@D   	# Zs   B#CC"	c                $   < V ^8  d   QhRS[ RR/# r  r  )rH   rI   s   "rJ   rK   r  j  s     % %6 %d %rM   c                    V P                   ;_uu_ 4        V P                  V RRR4       R#   + '       g   i     R# ; i)zEDelete a task if it exists.

Args:
    task_id (TaskID): A task ID.

N)rl  r  )rT   rD   s   &&rJ   remove_taskProgress.remove_taskj  s%     ZZZG$ ZZZs   ->	)rl  r  r  r   r   r  r   r_   r  r  r  )Nr   N
Working...皙?rg   r#  NNNr?  r#  NNN)r  )Tr`  r   T)$r{   r|   r}   r~   r   rS   r  r  r$  r   r  r  r  ri   r4  rk   ry   r   r;  typingoverloadrF  r  r  ra   r  r]   r\   r  r  r  r  r  r  r   r   r%  s   @rJ   rC   rC   '  s    "$ &*"$ "	"$
 %'"$ (,"$  "$ !%"$ !%"$ /3"$ "$ "$ "$H 
 
< ! ! . .
 , ,
 G G* *
! !  ) )V(@
 %)(@ ((@ (@T __  $ %) (   __  $ %) (  K  $K %)K (K KZ2 2* *; "&	;
 &*; $(; &*; #'; ; ;z% 	%
 "&% % #'% &*% %N1 1<   
 
 
 B) )
) )V% %rM   rC   __main__)Panel)Rule)Syntax)r8   a~  def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
    """Iterate and generate a tuple with a flag for last value."""
    iter_values = iter(values)
    try:
        previous_value = next(iter_values)
    except StopIteration:
        return
    for value in iter_values:
        yield False, previous_value
        previous_value = value
    yield True, previous_valuepython)line_numbersfoobarbaz123z:Text may be printed while the progress bars are rendering.z(In fact, [i]any[/i] renderable will workzSuch as [magenta]tables[/]...zPretty printed structures...typeexampler  zPretty printedz	Syntax...zGive it a try!)cycle)recordz[red]Downloadingr  r  z[green]Processingz[yellow]Thinkingr  r   g333333?g{Gz?)      )r,     )r  Nr   TNFN
   r   r   r   r   r  FTr  r  )r  sysr  r  abcr   r   collectionsr   dataclassesr   r   datetimer	   r
   r   mathr   r   operatorr   osr   r   	threadingr   r   r   typesr   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   version_infor'   pip._vendor.typing_extensionsr)   r|  r*   r+   r   r,   r-   r.   r/   r  r0   jupyterr1   r_   r2   progress_barr4   r  r5   r   r6   r  r7   r8   r  r9   r:   r   r;   r<   rG   r  r=   r?   r   r   r'  r;  r  rF  rN  rq  r  r   r   r  r   r   r  r   r  r:  r6  r<  r]  rC   r{   randomtimepanelr  ruler  syntaxr  r  progress_renderables	itertoolsr*  examplesr  rB   r  task1task2task3r  ra   sleeprandintr  r   rZ   rM   rJ   <module>rK     s   	 
   #  (  .      * *     * v5w2 # B B $ !  %      	3	~&2u9% ^^D&(+%6 %PI
Xd1i d1N8>"%wr{ 8*>* $	>*
 >* "&>* >* /3>* !#>* ">* !/>* !/>* )>* >*B 	  	 $	 	 "&	 	 /3	 !#	 "	  !/!	" !/#	$ )%	& '	 	0 	  	 $	 	 "&	 	 /3	 !#	 "	  !/!	" !/#	$ )%	& '	 	0S*  S* $S* S* "&S* S* /3S* !#S* "S*  !/!S*" !/#S*$ )%S*& 'S* S*l'1S '1T~ "/N /d <'
 '
T	: 	:E EP-,. -,`:^ :@. @
 
6.^ .b	D. 	D%Z % z# z# z#zK	%| K	%\ z
	" 	F  %&E	MM#sC  	E89'&	F$45
  )*HT"G	
		%	%	'
 	
 	

 
 
 
!!"4D!A!!"5T!B!!"4D!A###OOE3O/OOE3O/JJt~~a%)T(^, $
 
] \
 
 
s   <AQAQQQ	