+
    i                    ^   ^ RI H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/H0t0H1t1 ]'       d   ^ 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]0! 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)    )annotationsN)ABCabstractmethoddeque)	dataclassfield)	timedelta)	RawIOBaseUnsupportedOperation)ceil)mmap)length_hint)PathLikestat)EventRLockThread)TracebackType)TYPE_CHECKINGAnyBinaryIOCallableContextManagerDequeDictGenericIterableListLiteral
NamedTupleNewTypeOptionalTextIOTupleTypeTypeVarUnion)Self)filesizeget_console)ConsoleGroupJustifyMethodRenderableType)Highlighter)JupyterMixin)Live)ProgressBar)Spinner)	StyleType)ColumnTable)TextTextTypeTaskIDProgressType_Ic                  V   a  ] tR t^@tRtR V 3R lltR R ltR R ltR R	 ltR
t	V ;t
# )_TrackThreadz)A thread to periodically update progress.c               $    V ^8  d   QhRRRRRR/# )   progress
'Progress'task_idz'TaskID'update_periodfloat )formats   "`/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_vendor/rich/progress.py__annotate___TrackThread.__annotate__C   s!     & & &h &u &    c                	x   < Wn         W n        W0n        \        4       V n        ^ V n        \        SV `  RR7       R# )r   T)daemonN)rA   rC   rD   r   done	completedsuper__init__)selfrA   rC   rD   	__class__s   &&&&rH   rQ   _TrackThread.__init__C   s3     *G	%rK   c                   V ^8  d   QhRR/# r@   returnNonerF   )rG   s   "rH   rI   rJ   L   s     S ST SrK   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)rO   refreshN)
rC   rA   advancerD   rN   waitlive
is_startedrO   update)rR   rC   r[   rD   last_completedr\   rO   s   &      rH   run_TrackThread.runL   s    ,,--''**yy~~}%%$--*<*<*G*G*GI*^!;<!*T\\T^^TRrK   c                   V ^8  d   QhRR/# )r@   rW   z'_TrackThread'rF   )rG   s   "rH   rI   rJ   Z   s      > rK   c                	&    V P                  4        V # NstartrR   s   &rH   	__enter___TrackThread.__enter__Z       

rK   c               (    V ^8  d   QhRRRRRRRR/# 	r@   exc_typezOptional[Type[BaseException]]exc_valzOptional[BaseException]exc_tbzOptional[TracebackType]rW   rX   rF   )rG   s   "rH   rI   rJ   ^   s2      / ) (	
 
rK   c                	Z    V P                   P                  4        V P                  4        R # re   )rN   setjoinrR   rn   ro   rp   s   &&&&rH   __exit___TrackThread.__exit__^   s     					rK   )rO   rN   rA   rC   rD   )__name__
__module____qualname____firstlineno____doc__rQ   ra   ri   ru   __static_attributes____classcell__rS   s   @rH   r>   r>   @   s%    3& &S rK   r>   TFbar.backbar.completebar.finished	bar.pulsec          "     \    V ^8  d   QhRRRRRRRRR	R
RRRR
RRRRRRRRRRRRRRRR
RR
RR/# )r@   sequenceIterable[ProgressType]descriptionstrtotalOptional[float]rO   intauto_refreshboolconsoleOptional[Console]	transientget_timeOptional[Callable[[], float]]refresh_per_secondrE   styler5   complete_stylefinished_stylepulse_stylerD   disable
show_speedrW   rF   )rG   s   "rH   rI   rI   h   s     K
 K
$K
K
 K
 	K

 K
 K
 K
 ,K
 K
 K
 K
 K
 K
 K
 K
  !K
" #K
rK   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)aU  Track progress by iterating over a sequence.

You can also track progress of an iterable, which might require that you additionally specify ``total``.

Args:
    sequence (Iterable[ProgressType]): Values you wish to iterate over and track progress.
    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   rO   r   rD   N)
TextColumnextend	BarColumnTaskProgressColumnTimeRemainingColumnProgresstrack)r   r   r   rO   r   r   r   r   r   r   r   r   r   rD   r   r   columnsrA   s   &&&&&&&&&&&&&&&&  rH   r   r   h   s     X EP>	?@UW  NN--'	 *5d;		
 	!  	
  .33 H 
>>#' " 
 	
 	
 
	
 
s0   A5B67B"B B"
B6 B""B3	-	B6c                  T   ] tR t^tRtR0R R lltR R ltR R ltR R	 ltR
 R lt	]
R R l4       tR R ltR R lt]
R R l4       t]
R R l4       tR R ltR R ltR R ltR1R R lltR R ltR1R  R! lltR1R" R# lltR$ R% ltR2R& R' lltR( R) ltR* R+ ltR, R- ltR.tR/# )3_Readerz9A reader that tracks progress while it's being read from.c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r@   handler   rA   rB   taskr:   close_handler   rW   rX   rF   )rG   s   "rH   rI   _Reader.__annotate__   s<        	
  
rK   c                	D    Wn         W n        W0n        W@n        R V n        R# FN)r   rA   r   r   _closed)rR   r   rA   r   r   s   &&&&&rH   rQ   _Reader.__init__   s       	(rK   c                   V ^8  d   QhRR/# )r@   rW   z	'_Reader'rF   )rG   s   "rH   rI   r      s      9 rK   c                	:    V P                   P                  4        V # re   )r   ri   rh   s   &rH   ri   _Reader.__enter__   s    rK   c               (    V ^8  d   QhRRRRRRRR/# rm   rF   )rG   s   "rH   rI   r      s2      / ) (	
 
rK   c                	&    V P                  4        R # re   )closert   s   &&&&rH   ru   _Reader.__exit__   s     	

rK   c                   V ^8  d   QhRR/# )r@   rW   r   rF   )rG   s   "rH   rI   r      s      ( rK   c                	    V # re   rF   rh   s   &rH   __iter___Reader.__iter__   s    rK   c                   V ^8  d   QhRR/# )r@   rW   bytesrF   )rG   s   "rH   rI   r      s      % rK   c                	    \        V P                  4      pV P                  P                  V P                  \        V4      R 7       V# r[   )nextr   rA   r[   r   len)rR   lines   & rH   __next___Reader.__next__   s4    DKK diiT;rK   c                   V ^8  d   QhRR/# r@   rW   r   rF   )rG   s   "rH   rI   r      s       rK   c                	    V P                   # re   )r   rh   s   &rH   closed_Reader.closed   s    ||rK   c                   V ^8  d   QhRR/# r@   rW   r   rF   )rG   s   "rH   rI   r      s     $ $ $rK   c                	6    V P                   P                  4       # re   )r   filenorh   s   &rH   r   _Reader.fileno       {{!!##rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   r      s     $ $ $rK   c                	6    V P                   P                  4       # re   )r   isattyrh   s   &rH   r   _Reader.isatty   r   rK   c                   V ^8  d   QhRR/# r@   rW   r   rF   )rG   s   "rH   rI   r              c  rK   c                	.    V P                   P                  # re   )r   moderh   s   &rH   r   _Reader.mode       {{rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   r      r   rK   c                	.    V P                   P                  # re   )r   namerh   s   &rH   r   _Reader.name   r   rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   r           & &$ &rK   c                	6    V P                   P                  4       # re   )r   readablerh   s   &rH   r   _Reader.readable       {{##%%rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   r      r   rK   c                	6    V P                   P                  4       # re   )r   seekablerh   s   &rH   r   _Reader.seekable   r   rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   r      s      $ rK   c                	    R # )FrF   rh   s   &rH   writable_Reader.writable   s    rK   c                    V ^8  d   QhRRRR/# r@   sizer   rW   r   rF   )rG   s   "rH   rI   r      s       e rK   c                	    V P                   P                  V4      pV P                  P                  V P                  \        V4      R 7       V# r   )r   readrA   r[   r   r   )rR   r   blocks   && rH   r   _Reader.read   s:      &diiU<rK   c                   V ^8  d   QhRR/# )r@   bz"Union[bytearray, memoryview, mmap]rF   )rG   s   "rH   rI   r      s      < rK   c                	    V P                   P                  V4      pV P                  P                  V P                  VR 7       V# r   )r   readintorA   r[   r   )rR   r   ns   && rH   r   _Reader.readinto   s6    KK  #dii3rK   c                    V ^8  d   QhRRRR/# r   rF   )rG   s   "rH   rI   r      s      S % rK   c                	    V P                   P                  V4      pV P                  P                  V P                  \        V4      R 7       V# r   )r   readlinerA   r[   r   r   )rR   r   r   s   && rH   r   _Reader.readline   s:    {{##D)diiT;rK   c                    V ^8  d   QhRRRR/# )r@   hintr   rW   zList[bytes]rF   )rG   s   "rH   rI   r     s      c ; rK   c           	     	    V P                   P                  V4      pV P                  P                  V P                  \        \        \        V4      4      R 7       V# r   )r   	readlinesrA   r[   r   summapr   )rR   r   liness   && rH   r  _Reader.readlines  sA    %%d+diiSe_1EFrK   c                   V ^8  d   QhRR/# rV   rF   )rG   s   "rH   rI   r   	  s      t rK   c                	l    V P                   '       d   V P                  P                  4        R V n        R# )TN)r   r   r   r   rh   s   &rH   r   _Reader.close	  s%    KKrK   c               $    V ^8  d   QhRRRRRR/# )r@   offsetr   whencerW   rF   )rG   s   "rH   rI   r     s!      3  C rK   c                	    V P                   P                  W4      pV P                  P                  V P                  VR 7       V# )rO   )r   seekrA   r_   r   )rR   r
  r  poss   &&& rH   r  _Reader.seek  s6    kkv.TYY#6
rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   r     s     " "c "rK   c                	6    V P                   P                  4       # re   )r   tellrh   s   &rH   r  _Reader.tell  s    {{!!rK   c                    V ^8  d   QhRRRR/# )r@   sr   rW   r   rF   )rG   s   "rH   rI   r     s     , ,s ,s ,rK   c                	    \        R 4      h)writer   )rR   r  s   &&rH   r  _Reader.write  s    "7++rK   c                    V ^8  d   QhRRRR/# )r@   r  zIterable[Any]rW   rX   rF   )rG   s   "rH   rI   r     s     1 1 1$ 1rK   c                	    \        R 4      h)
writelinesr  )rR   r  s   &&rH   r  _Reader.writelines  s    "<00rK   )r   r   r   rA   r   N)T))r   )rw   rx   ry   rz   r{   rQ   ri   ru   r   r   propertyr   r   r   r   r   r   r   r   r   r   r   r  r   r  r  r  r  r|   rF   rK   rH   r   r      s    C
  $$        &&





",1 1rK   r   c                  >    ] tR tRtRtR R ltR R ltR R ltR	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RRR/# )r@   rA   rB   readerr<   rW   rX   rF   )rG   s   "rH   rI   _ReadContext.__annotate__   s!     ! ! !R !D !rK   c                	    Wn         W n        R # re   rA   r$  )rR   rA   r$  s   &&&rH   rQ   _ReadContext.__init__   s      rK   c                   V ^8  d   QhRR/# )r@   rW   r<   rF   )rG   s   "rH   rI   r%  $  s     ' '2 'rK   c                	j    V P                   P                  4        V P                  P                  4       # re   )rA   rg   r$  ri   rh   s   &rH   ri   _ReadContext.__enter__$  s%    {{$$&&rK   c               (    V ^8  d   QhRRRRRRRR/# rm   rF   )rG   s   "rH   rI   r%  (  s2     8 8/8 )8 (	8
 
8rK   c                	r    V P                   P                  4        V P                  P                  WV4       R # re   )rA   stopr$  ru   rt   s   &&&&rH   ru   _ReadContext.__exit__(  s(     	X7rK   r'  N)	rw   rx   ry   rz   r{   rQ   ri   ru   r|   rF   rK   rH   r"  r"    s    O!'8 8rK   r"  r   
Reading...r   r   r   r   r   r   r   r   r   r   c               P    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRR/# )r@   filer   r   r   r   r   r   r   r   r   r   r   r   r   rE   r   r5   r   r   r   r   rW   ContextManager[BinaryIO]rF   )rG   s   "rH   rI   rI   2  s     >* >*
>*>* 	>*
 >* >* >* ,>* >* >* >* >* >* >* >*rK   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   r   	wrap_filer"  )r2  r   r   r   r   r   r   r   r   r   r   r   r   r   rA   r$  s   &&$$$$$$$$$$$   rH   r6  r6  2  s    J EP>	?@UW  NN--'	 !		
 	!  	
  .33 H {KF))rK   r   c          &     d    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRR/# ) r@   r2  "Union[str, 'PathLike[str]', bytes]r   z"Union[Literal['rt'], Literal['r']]	bufferingr   encodingOptional[str]errorsnewliner   Optional[int]r   r   r   r   r   r   r   r   r   r   rE   r   r5   r   r   r   r   rW   zContextManager[TextIO]rF   )rG   s   "rH   rI   rI   t  s     	 	
,	
,	 	 		
 	 	 	 	 	 	 	 ,	 	 	  !	" #	$ %	& '	( )	rK   c                   R # re   rF   r2  r   r9  r:  r<  r=  r   r   r   r   r   r   r   r   r   r   r   r   s   &&&&&&$$$$$$$$$$$$rH   openrA  s      , 	rK   c          &     d    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRR/# ) r@   r2  r8  r   Literal['rb']r9  r   r:  r;  r<  r=  r   r>  r   r   r   r   r   r   r   r   r   r   rE   r   r5   r   r   r   r   rW   r3  rF   )rG   s   "rH   rI   rI     s     	 	
,	
	 	 		
 	 	 	 	 	 	 	 ,	 	 	  !	" #	$ %	& '	( )	rK   c                   R # re   rF   r@  s   &&&&&&$$$$$$$$$$$$rH   rA  rA    rB  rK   c          &     d    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRRRRRRRRRRRRRRRR/# ) r@   r2  r8  r   1Union[Literal['rb'], Literal['rt'], Literal['r']]r9  r   r:  r;  r<  r=  r   r>  r   r   r   r   r   r   r   r   r   r   rE   r   r5   r   r   r   r   rW   z7Union[ContextManager[BinaryIO], ContextManager[TextIO]]rF   )rG   s   "rH   rI   rI     s     S* S*
,S*
;S* S* 	S*
 S* S* S* S* S* S* S* ,S* S* S*  !S*" #S*$ %S*& 'S*( =)S*rK   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   r9  r:  r<  r=  r   r   )r   r   r   r5  r   r   rA  r"  )r2  r   r9  r:  r<  r=  r   r   r   r   r   r   r   r   r   r   r   r   r   rA   r$  s   &&&&&&$$$$$$$$$$$$   rH   rA  rA    s    b EP>	?@UW  NN--'	 !		
 	!  	
  .33 H ]]  	F &))rK   c                  h    ] tR tRt$ RtRtR]R&   RR R lltR R	 ltR
 R lt	]
R R l4       tRtR# )ProgressColumni  z3Base class for a widget to use in progress display.Nr   max_refreshc                    V ^8  d   QhRRRR/# )r@   table_columnOptional[Column]rW   rX   rF   )rG   s   "rH   rI   ProgressColumn.__annotate__   s     2 2%5 2 2rK   c                	.    Wn         / V n        R V n        R # re   )_table_column_renderable_cache_update_time)rR   rM  s   &&rH   rQ   ProgressColumn.__init__   s    )MO-1rK   c                   V ^8  d   QhRR/# )r@   rW   r6   rF   )rG   s   "rH   rI   rO    s     . .& .rK   c                >    V P                   ;'       g    \        4       # )z.Get a table column, used to build tasks table.)rQ  r6   rh   s   &rH   get_table_columnProgressColumn.get_table_column  s    !!--VX-rK   c                    V ^8  d   QhRRRR/# r@   r   'Task'rW   r/   rF   )rG   s   "rH   rI   rO  	  s      V  rK   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   rK  rO   rR  idKeyErrorrender)rR   r   current_time	timestamp
renderables   &&   rH   __call__ProgressColumn.__call__	  s     }}'&(,(>(>tww(G%	 ///,>%% ? [[&
+7*Dtww'  s   B B&%B&c                    V ^8  d   QhRRRR/# rZ  rF   )rG   s   "rH   rI   rO  !  s     1 16 1n 1rK   c                    R# )z"Should return a renderable object.NrF   rR   r   s   &&rH   r_  ProgressColumn.render   s    rK   )rR  rQ  rS  re   )rw   rx   ry   rz   r{   rK  __annotations__rQ   rW  rc  r   r_  r|   rF   rK   rH   rJ  rJ    s2    =#'K'2
.. 1 1rK   rJ  c                  J   a  ] tR tRtRtR
RR/R V 3R lllltR R ltR	tV ;t# )RenderableColumni%  zA column to insert an arbitrary column.

Args:
    renderable (RenderableType, optional): Any renderable. Defaults to empty string.
rM  Nc                    V ^8  d   QhRRRR/# )r@   rb  r/   rM  rN  rF   )rG   s   "rH   rI   RenderableColumn.__annotate__,  s     4 4(4@P4rK   c               	4   < Wn         \        SV `	  VR 7       R# rM  N)rb  rP   rQ   )rR   rb  rM  rS   s   &&$rH   rQ   RenderableColumn.__init__,  s     %l3rK   c                    V ^8  d   QhRRRR/# rZ  rF   )rG   s   "rH   rI   rm  2  s      6 n rK   c                	    V P                   # re   rb  rg  s   &&rH   r_  RenderableColumn.render2  s    rK   rt  ) 	rw   rx   ry   rz   r{   rQ   r_  r|   r}   r~   s   @rH   rk  rk  %  s$    4SW4 4 rK   rk  c                  R   a  ] tR tRtRtR
R V 3R llltRR R lltR R ltR	tV ;t	# )SpinnerColumni6  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          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r@   spinner_namer   r   Optional[StyleType]speedrE   finished_textr9   rM  rN  rF   )rG   s   "rH   rI   SpinnerColumn.__annotate__@  s<     4 44 #4 	4
  4 '4rK   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}  rp  N)	r4   spinner
isinstancer   r8   from_markupr~  rP   rQ   )rR   r{  r   r}  r~  rM  rS   s   &&&&&&rH   rQ   SpinnerColumn.__init__@  sO     |F --- ]+ 	
 	l3rK   c               (    V ^8  d   QhRRRRRRRR/# )	r@   r{  r   spinner_styler|  r}  rE   rW   rX   rF   )rG   s   "rH   rI   r  P  s8     O OO +O 	O
 
OrK   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)r4   r  )rR   r{  r  r}  s   &&&&rH   set_spinnerSpinnerColumn.set_spinnerP  s     |NrK   c                    V ^8  d   QhRRRR/# rZ  rF   )rG   s   "rH   rI   r  _  s      6 n rK   c                	    VP                   '       d   V P                  pV# V P                  P                  VP	                  4       4      pV# re   )finishedr~  r  r_  r   )rR   r   texts   && rH   r_  SpinnerColumn.render_  sJ     }}}  	
  $$T]]_5 	
 rK   )r~  r  )dotsprogress.spinner      ? N)r  r  )
rw   rx   ry   rz   r{   rQ   r  r_  r|   r}   r~   s   @rH   ry  ry  6  s"    4 4 O rK   ry  c                  B   a  ] tR tRtRtRR V 3R llltR R ltRtV ;t# )	r   ih  zA column containing text.c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r@   text_formatr   r   r5   justifyr.   markupr   highlighterOptional[Highlighter]rM  rN  rW   rX   rF   )rG   s   "rH   rI   TextColumn.__annotate__k  sY     L LL L 	L
 L +L 'L 
LrK   c                	   < Wn         W0n        W n        W@n        WPn        \
        ST `  T;'       g    \        R R7      R7       R# )Tno_wraprp  N)r  r  r   r  r  rP   rQ   r6   )rR   r  r   r  r  r  rM  rS   s   &&&&&&&rH   rQ   TextColumn.__init__k  s=     '&-
&l&J&JfT6JKrK   c                    V ^8  d   QhRRRR/# r@   r   r[  rW   r8   rF   )rG   s   "rH   rI   r  {  s      6 d rK   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  rG   r  r8   r  r   r  r  	highlight)rR   r   _textr  s   &&  rH   r_  TextColumn.render{  sw      ''T'2;;;##ET\\RDZZFD&&t,rK   )r  r  r  r   r  )noneleftTNNrw  r~   s   @rH   r   r   h  s    #L L  rK   r   c                  B   a  ] tR tRtRtRR V 3R llltR R ltR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               4    V ^8  d   QhRRRRRRRRRRRR	R
R/# )r@   	bar_widthr>  r   r5   r   r   r   rM  rN  rW   rX   rF   )rG   s   "rH   rI   BarColumn.__annotate__  sP     4 4 4 4 "	4
 "4 4 '4 
4rK   c                	d   < Wn         W n        W0n        W@n        WPn        \
        SV `  VR 7       R# ro  )r  r   r   r   r   rP   rQ   )rR   r  r   r   r   r   rM  rS   s   &&&&&&&rH   rQ   BarColumn.__init__  s1     #
,,&l3rK   c                    V ^8  d   QhRRRR/# )r@   r   r[  rW   r3   rF   )rG   s   "rH   rI   r    s     
 
6 
k 
rK   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   rO   widthpulseanimation_timer   r   r   r   )r3   r   maxrO   r  startedr   r   r   r   r   rg  s   &&rH   r_  BarColumn.render  s    (,

(>#a$D!T^^,..0$c!T^^6Lll"==?**....((

 
	
rK   )r  r   r   r   r   )(   r   r   r   r   Nrw  r~   s   @rH   r   r     s    4 4 
 
rK   r   c                  &    ] tR tRtRtR R ltRtR# )TimeElapsedColumni  zRenders time elapsed.c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI   TimeElapsedColumn.__annotate__  s     : :6 :d :rK   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elapsedr8   r
   r  r   r   )rR   r   r  deltas   &&  rH   r_  TimeElapsedColumn.render  sU    (,$$$4<<?	);<<#aW"67CJ&899rK   rF   Nrw   rx   ry   rz   r{   r_  r|   rF   rK   rH   r  r    s    : :rK   r  c                  X   a  ] tR tRtRtR
R V 3R lllt]R R l4       tR R ltR	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               <    V ^8  d   QhRRRRRRRRRR	R
RRRRR	RR/	# )r@   r  r   text_format_no_percentager   r5   r  r.   r  r   r  r  rM  rN  r   rW   rX   rF   )rG   s   "rH   rI   TaskProgressColumn.__annotate__  sd     
 

 $'
 	

 
 
 +
 '
 
 

rK   c	           	     	J   < W n         Wn        \        S	V `  VVVVVVR 7       R# ))r  r   r  r  r  rM  N)r  r   rP   rQ   )
rR   r  r  r   r  r  r  rM  r   rS   s
   &&&&&&&&&rH   rQ   TaskProgressColumn.__init__  s5     *C&$##% 	 	
rK   c                    V ^8  d   QhRRRR/# )r@   r}  r   rW   r8   rF   )rG   s   "rH   rI   r    s     S S ST SrK   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.
rv  zprogress.percentager    z.1fz it/s)rv  u   ×10³u   ×10⁶u   ×10⁹u   ×10¹²)r8   r*   pick_unit_and_suffixr   )clsr}  unitsuffix
data_speeds   &&   rH   render_speedTaskProgressColumn.render_speed  s[     ="78844J<

 \
z#&vhe4<QRRrK   c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI   r    s      6 d rK   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  rG   r  r8   r  r   r  r  r  )rR   r   r  r  r  s   &&   rH   r_  TaskProgressColumn.render  s    ::$///$$T%8%8%F%FDJJGG.2jj.@D**dFVFV 	 """-;;;##ET\\RDZZFD&&t,rK   )r   r  )z-[progress.percentage]{task.percentage:>3.0f}%rv  r  r  TNNF)rw   rx   ry   rz   r{   rQ   classmethodr  r_  r|   r}   r~   s   @rH   r   r     s2    
 
, S S& rK   r   c                  F   a  ] tR tRtRtRtR	R V 3R llltR R ltR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RRRRR/# )r@   compactr   r   rM  rN  rF   )rG   s   "rH   rI    TimeRemainingColumn.__annotate__  s(     4 44  $4 '	4rK   c                	@   < Wn         W n        \        SV `  VR 7       R# ro  )r  r   rP   rQ   )rR   r  r   rM  rS   s   &&&&rH   rQ   TimeRemainingColumn.__init__  s      %:"l3rK   c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI   r    s     , ,6 ,d ,rK   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.remainingrv  r  z--:--r  02d:d)	r   r  r  time_remainingr   r8   r  divmodr   )rR   r   	task_timer   minutesr  hours	formatteds   &&      rH   r_  TimeRemainingColumn.render  s    %%%$---**I&E++I(E::%((4<<<eLLYeLL "#i."5,<<<"3-q6I )1WSM73-@II++rK   )r  r   )FFN)
rw   rx   ry   rz   r{   rK  rQ   r_  r|   r}   r~   s   @rH   r   r     s#     K4 4, ,rK   r   c                  &    ] tR tRtRtR R ltRtR# )FileSizeColumni4  zRenders completed filesize.c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI   FileSizeColumn.__annotate__7  s     : :6 :d :rK   c                n    \         P                  ! \        VP                  4      4      p\	        VRR7      # )Show data completed.zprogress.filesizer  )r*   decimalr   rO   r8   rR   r   	data_sizes   && rH   r_  FileSizeColumn.render7  s)    $$S%89	I%899rK   rF   Nr  rF   rK   rH   r  r  4  s    %: :rK   r  c                  &    ] tR tRtRtR R ltRtR# )TotalFileSizeColumni=  zRenders total filesize.c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI    TotalFileSizeColumn.__annotate__@  s     @ @6 @d @rK   c                    VP                   e*   \        P                  ! \        VP                   4      4      MRp\	        VRR7      # )r  rv  zprogress.filesize.totalr  )r   r*   r  r   r8   r  s   && rH   r_  TotalFileSizeColumn.render@  s4    9=9OH$$S_5UW	I%>??rK   rF   Nr  rF   rK   rH   r  r  =  s    !@ @rK   r  c                  B   a  ] tR tRtRtRR V 3R llltR R ltRtV ;t# )	MofNCompleteColumniF  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                    V ^8  d   QhRRRR/# )r@   	separatorr   rM  rN  rF   )rG   s   "rH   rI   MofNCompleteColumn.__annotate__R  s     4 4# 4;K 4rK   c                	4   < Wn         \        SV `	  VR 7       R# ro  )r  rP   rQ   )rR   r  rM  rS   s   &&&rH   rQ   MofNCompleteColumn.__init__R  s    "l3rK   c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI   r  V  s     
 
6 
d 
rK   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   rO   r   r   r   r8   r  )rR   r   rO   r   total_widths   &&   rH   r_  MofNCompleteColumn.renderV  sa    '	#'::#9DJJs#e*oa((8@%
 	
rK   )r  )/Nrw  r~   s   @rH   r   r   F  s    	4 4
 
rK   r   c                  B   a  ] tR tRtRtRR V 3R llltR R ltRtV ;t# )	r5  ia  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RRRRR/# )r@   binary_unitsr   rM  rN  rW   rX   rF   )rG   s   "rH   rI   DownloadColumn.__annotate__h  s$     4 4 48H4	4rK   c                	4   < Wn         \        SV `	  VR 7       R# ro  )r  rP   rQ   )rR   r  rM  rS   s   &&&rH   rQ   DownloadColumn.__init__h  s     )l3rK   c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI   r  n  s     ! !6 !d !rK   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   rO   r   r  r*   r  r8   )rR   r   rO    unit_and_suffix_calculation_baser  r  	precisioncompleted_ratiocompleted_strr   total_ratio	total_strdownload_statusdownload_texts   &&            rH   r_  DownloadColumn.rendern  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rK   )r  r   rw  r~   s   @rH   r5  r5  a  s    4 4! !rK   r5  c                  &    ] tR tRtRtR R ltRtR# )TransferSpeedColumni  z&Renders human readable transfer speed.c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI    TransferSpeedColumn.__annotate__  s     D D6 Dd DrK   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}  r8   r*   r  r   )rR   r   r}  r  s   &&  rH   r_  TransferSpeedColumn.render  sU    ##11tzz=#899%%c%j1
zl"%-BCCrK   rF   Nr  rF   rK   rH   r0  r0    s    0D DrK   r0  c                  2    ] tR tRt$ RtR]R&    R]R&   RtR# )ProgressSamplei  z$Sample of progress for a given time.rE   ra  rO   rF   N)rw   rx   ry   rz   r{   ri  r|   rF   rK   rH   r6  r6    s    .$rK   r6  c                     ] tR tRt$ RtR]R&    R]R&    R]R&    R	]R
&    R]R&    RtR]R&    RtR]R&    ]! ]	R7      t
R]R&    ]! RRRR7      tR]R&    ]! RRRR7      tR]R&    RtR]R&    ]! R RRR7      tR]R&   ]! R]R7      tR]R &    R! R" lt]R# R$ l4       t]R% R& l4       t]R' R( l4       t]R) R* l4       t]R+ R, l4       t]R- R. l4       t]R/ R0 l4       tR1 R2 ltR3tR# )4Taski  z}Information regarding a progress task.

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

r:   r]  r   r   r   r   rE   rO   GetTimeCallable	_get_timeNr  Tr   visible)default_factoryzDict[str, Any]fieldsF)defaultinitrepr
start_time	stop_timer  c                 	    \        R R7      # )r  )maxlenr   rF   rK   rH   <lambda>Task.<lambda>  s	    T 2rK   )r<  r?  r@  zDeque[ProgressSample]	_progress)r@  r<  r   _lockc                   V ^8  d   QhRR/# r@   rW   rE   rF   )rG   s   "rH   rI   Task.__annotate__  s        %  rK   c                "    V P                  4       # )z(float: Get the current time, in seconds.)r:  rh   s   &rH   r   Task.get_time  s    ~~rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   rK    s     + + +rK   c                    V P                   RJ# )z#bool: Check if the task as started.N)rA  rh   s   &rH   r  Task.started  s     d**rK   c                   V ^8  d   QhRR/# r@   rW   r   rF   )rG   s   "rH   rI   rK    s     + +? +rK   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   rO   rh   s   &rH   	remainingTask.remaining  s$     ::zzDNN**rK   c                   V ^8  d   QhRR/# rR  rF   )rG   s   "rH   rI   rK    s     1 1 1rK   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)rA  rB  r   rh   s   &rH   r  Task.elapsed  sC     ??">>%>>DOO33}}00rK   c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   rK    s     . .$ .rK   c                    V P                   RJ# )zCheck if the task has finished.N)r  rh   s   &rH   r  Task.finished  s     !!--rK   c                   V ^8  d   QhRR/# rJ  rF   )rG   s   "rH   rI   rK    s      E rK   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   rO   minr  )rR   rO   s   & rH   
percentageTask.percentage  s@     zzz^^djj0E9	s3	23	rK   c                   V ^8  d   QhRR/# rR  rF   )rG   s   "rH   rI   rK    s       rK   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re   r  ).0samples   & rH   	<genexpr>Task.speed.<locals>.<genexpr>  s     !Ov"2"2   r  )rA  rH  rG  ra  iterr   r  )rR   rA   
total_timeiter_progresstotal_completedr}  s   &     rH   r}  
Task.speed  s     ??"ZZZ~~H Z ""//(1+2G2GGJQ Z !NM!!O!OOO#0E ZZZs   B>3B>1B>>C	c                   V ^8  d   QhRR/# rR  rF   )rG   s   "rH   rI   rK    s       rK   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}  rU  r   )rR   r}  rU  estimates   &   rH   r  Task.time_remaining  sC     ===

NN		)*rK   c                   V ^8  d   QhRR/# rV   rF   )rG   s   "rH   rI   rK    s     # # #rK   c                V    V P                   P                  4        RV n        RV n        R# )zReset progress.N)rG  clearr  r  rh   s   &rH   _resetTask._reset  s"    !"rK   )r  r  )rw   rx   ry   rz   r{   ri  r  r;  r	   dictr=  rA  rB  r  rG  r   rH  r   r   r  rU  r  r  rb  r}  r  rx  r|   rF   rK   rH   r8  r8    sd    	JG'>*+%)M?)(GTJ"48FN8?"'5u"MJMN!&t%e!LILN&*NO*>',2U(I$  eU;E5;  + + + + 1 1 . .    "  # #rK   r8  c                     ] tR tRtRtRRRRR^
RR	R
RRRRRRRRRRR/
R R llt]R R l4       t]R R l4       t	]R R l4       t
]R R l4       t]R R l4       tR R ltR R  ltR! R" ltR# R$ ltRQR% R& lltRRR'RR(R)/R* R+ lllt]P(                  RSR,RR'RR(R)/R- R. lll4       t]P(                  RSR,RR'RR(R)/R/ R0 lll4       tRTR,RR'RR(R)/R1 R2 llltR3 R4 ltR5 R6 ltR,RR7RR8RR(RR9RR:R/R; R< lltR=RR,RR7^ R9RR(R/R> R? lltRUR@ RA lltRB RC ltRD RE ltRF RG ltRH RI ltRJ RK ltRVRL RM llt RN RO lt!RPt"R# )Wr   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               H    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRR/# )r@   r   zUnion[str, ProgressColumn]r   r   r   r   r   rE   r|  r   r}  r~  r   zOptional[GetTimeCallable]r   r  rW   rX   rF   )rG   s   "rH   rI   Progress.__annotate__5  s     "$ "$,"$ #"$ 	"$
 ""$  %"$ "$ "$ "$ ,"$ "$ "$ 
"$rK   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   rH  get_default_columnsr   r|  r   r  _tasksr:   _task_indexr2   r+   r  r]   r   r   printlog)rR   r   r   r   r|  r   r}  r~  r   r   r  r   s   &$$$$$$$$$$*rH   rQ   Progress.__init__5  s     "A%G'GG%W
<<$":":"<%:"*,#)!9,,{}%1++..
	 !99DLL$9$9\\''
<<##rK   c                   V ^8  d   QhRR/# )r@   rW   zTuple[ProgressColumn, ...]rF   )rG   s   "rH   rI   r  Z  s     
 
$> 
rK   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   &rH   r  Progress.get_default_columnsY  s(    2 ABK !	
 	
rK   c                   V ^8  d   QhRR/# )r@   rW   r,   rF   )rG   s   "rH   rI   r  y  s     ! ! !rK   c                	.    V P                   P                  # re   )r]   r   rh   s   &rH   r   Progress.consolex  s    yy   rK   c                   V ^8  d   QhRR/# )r@   rW   z
List[Task]rF   )rG   s   "rH   rI   r  }  s     . .z .rK   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)rH  listr  valuesrh   s   &rH   tasksProgress.tasks|  s.     ZZZ**,- ZZZ   #AA	c                   V ^8  d   QhRR/# )r@   rW   zList[TaskID]rF   )rG   s   "rH   rI   r    s     , ,, ,rK   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)rH  r  r  keysrh   s   &rH   task_idsProgress.task_ids  s.     ZZZ((*+ ZZZr  c                   V ^8  d   QhRR/# r   rF   )rG   s   "rH   rI   r    s     G G$ GrK   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re   )r  )rg  r   s   & rH   ri  $Progress.finished.<locals>.<genexpr>  s     F1E}}1Erk  F)rH  r  allr  rh   s   &rH   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/# rV   rF   )rG   s   "rH   rI   r    s     * *t *rK   c                f    V P                   '       g   V P                  P                  RR7       R# R# )zStart the progress display.T)rZ   N)r   r]   rg   rh   s   &rH   rg   Progress.start  s"    |||IIOODO) rK   c                   V ^8  d   QhRR/# rV   rF   )rG   s   "rH   rI   r    s     ! !d !rK   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]   r.  r   is_interactive
is_jupyterr  rh   s   &rH   r.  Progress.stop  sH    		||***4<<3J3J3JLL  4K*rK   c                   V ^8  d   QhRR/# )r@   rW   r)   rF   )rG   s   "rH   rI   r    s      4 rK   c                	&    V P                  4        V # re   rf   rh   s   &rH   ri   Progress.__enter__  rk   rK   c               (    V ^8  d   QhRRRRRRRR/# rm   rF   )rG   s   "rH   rI   r    s2      / ) (	
 
rK   c                	&    V P                  4        R # re   )r.  rt   s   &&&&rH   ru   Progress.__exit__  s     			rK   c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r@   r   r   r   r   rO   r   rC   Optional[TaskID]r   r   rD   rE   rW   rF   )rG   s   "rH   rI   r    sP     + +(+ + 	+
 "+ + + 
 +rK   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.

You can also track progress of an iterable, which might require that you additionally specify ``total``.

Args:
    sequence (Iterable[ProgressType]): 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.
NrT  )
rE   r   add_taskr_   r]   r   r>   rO   r[   rZ   )rR   r   r   rO   rC   r   rD   track_threadvaluer[   rZ   s   &&&&&&&    rH   r   Progress.track  s     0 =+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<rC   r   r0  c          
     ,    V ^8  d   QhRRRRRRRRR	R/# )
r@   r2  r   r   r>  rC   r  r   r   rW   rF   )rG   s   "rH   rI   r    sC     (@ (@(@ (@
 "(@ (@ 
(@rK   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   )rH  r  r   
ValueErrorr  r_   r   )rR   r2  r   rC   r   total_bytess   &&&$$ rH   r6  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RRRRRRRR	RR
RRRRRRRRR/
# )r@   r2  r8  r   rD  r9  r   r:  r;  r<  r=  r   r>  rC   r  r   r   rW   r   rF   )rG   s   "rH   rI   r    sn      0  	
      "  
rK   c               	    R # re   rF   
rR   r2  r   r9  r:  r<  r=  r   rC   r   s
   &&&&&&&$$$rH   rA  Progress.open       	rK   c               @    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRR/
# )r@   r2  r8  r   z"Union[Literal['r'], Literal['rt']]r9  r   r:  r;  r<  r=  r   r>  rC   r  r   r   rW   r$   rF   )rG   s   "rH   rI   r    sn      0 1 	
      "  
rK   c               	    R # re   rF   r  s
   &&&&&&&$$$rH   rA  r    r  rK   c               @    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRR/
# )r@   r2  r8  r   rG  r9  r   r:  r;  r<  r=  r   r>  rC   r  r   r   rW   zUnion[BinaryIO, TextIO]rF   )rG   s   "rH   rI   r    s{     K K0K @K 	K
  K K K K "K K 
!KrK   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.
rv  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  rb)r9  Tr  )r:  r<  r=  line_buffering)r  rtrr  )r  r  )r  r  )rs   sortedr  warningswarnRuntimeWarningr   st_sizer  r_   iorA  r   TextIOWrapper)rR   r2  r   r9  r:  r<  r=  r   rC   r   _moder  r   r$  s   &&&&&&&$$$    rH   rA  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 ;##!-  rK   c                    V ^8  d   QhRRRR/# r@   rC   r:   rW   rX   rF   )rG   s   "rH   rI   r  k  s     2 2& 2T 2rK   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)rH  r  rA  r   )rR   rC   r   s   && rH   
start_taskProgress.start_taskk  s>     ZZZ;;w'D&"&--/ ZZZs   7AA'	c                    V ^8  d   QhRRRR/# r  rF   )rG   s   "rH   rI   r  y  s     * * *D *rK   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)rH  r  r   rA  rB  )rR   rC   r   r`  s   &&  rH   	stop_taskProgress.stop_tasky  sF     ZZZ;;w'D==?L&".)N ZZZs   >AA.	rO   r[   r;  rZ   c               <    V ^8  d   QhRRRRRRRRRRR	R
RRRRRR/	# )r@   rC   r:   r   r   rO   r[   r   r;  r;  Optional[bool]rZ   r   r=  r   rW   rX   rF   )rG   s   "rH   rI   r    sd     ; ;; 	;
 #; !; #;  ; ; ; 
;rK   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)rH  r  rO   r   rx  r   r;  r=  r_   r   r|  rG  popleftra  appendr6  r  r  rZ   )rR   rC   r   rO   r[   r   r;  rZ   r=  r   completed_startupdate_completedr`  old_sample_timerG  r  s   &&$$$$$$,       rH   r_   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	rg   c               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/# )r@   rC   r:   rg   r   r   r   rO   r   r;  r  r   r;  r=  r   rW   rX   rF   )rG   s   "rH   rI   r    sZ     % %% 	%
 % %  % #% % 
%rK   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   rH  r  rx  rA  r   rO   r;  r=  r   r  rZ   )
rR   rC   rg   r   rO   r;  r   r=  r`  r   s
   &&$$$$$,  rH   resetProgress.reset  s    , }}ZZZ;;w'DKKM.3lDO "
&N"&$&#. !%D  	 Zs   AB-<B--B=	c               $    V ^8  d   QhRRRRRR/# )r@   rC   r:   r[   rE   rW   rX   rF   )rG   s   "rH   rI   r    s!     1 1v 1 1d 1rK   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   rH  r  rO   r|  rG  r  ra  r   r  r6  r   r  r  r}  r  )
rR   rC   r[   r`  r   r  r  r  rG  r  s
   &&&       rH   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/# rV   rF   )rG   s   "rH   rI   r  
  s          rK   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^   rZ   rh   s   &rH   rZ   Progress.refresh
  s1    |||		 4 4 4II !5|rK   c                   V ^8  d   QhRR/# r@   rW   r/   rF   )rG   s   "rH   rI   r    s       rK   c                4    \        V P                  4       !  pV# )z*Get a renderable for the progress display.)r-   get_renderables)rR   rb  s   & rH   r  Progress.get_renderable  s    D0023
rK   c                   V ^8  d   QhRR/# )r@   rW   zIterable[RenderableType]rF   )rG   s   "rH   rI   r    s      !9 rK   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  )rR   tables   & rH   r  Progress.get_renderables  s     %%djj1s   "$c                    V ^8  d   QhRRRR/# )r@   r  zIterable[Task]rW   r7   rF   )rG   s   "rH   rI   r    s      n  rK   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   r6   rW  copy)rg  _columns   & rH   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   rG   )rg  columnr   s   & rH   ri  r   /  sB       '3F  *&#66 #MMtM4!'. '3s   =A )r      )r   r7   gridr  r;  add_row)rR   r  table_columnsr  r   s   &&  @rH   r  Progress.make_tasks_table  so    
  <<
 

MN6N$++ND||| '+ll	  rK   c                   V ^8  d   QhRR/# r  rF   )rG   s   "rH   rI   r  :  s     ) ). )rK   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)rH  r  rh   s   &rH   __rich__Progress.__rich__:  s#    ZZZ&&( ZZZs	   0A	c               4    V ^8  d   QhRRRRRRRRR	RR
RRR/# )r@   r   r   rg   r   r   r   rO   r   r;  r=  r   rW   r:   rF   )rG   s   "rH   rI   r  ?  sP     ) )) ) 	)
 ) ) ) 
)rK   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=  r:  rH  N)	rH  r8  r  r   r  r  r:   r   rZ   )	rR   r   rg   r   rO   r;  r=  r   new_task_indexs	   &&&&&&,  rH   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RRR/# r  rF   )rG   s   "rH   rI   r  j  s     % %6 %d %rK   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)rH  r  )rR   rC   s   &&rH   remove_taskProgress.remove_taskj  s%     ZZZG$ ZZZs   ->	)rH  r  r  r   r   r  r   r]   r  r  r|  )Nr   N
Working...皙?re   r  NNNr  r  NNN)r  )Tr`  r   T)#rw   rx   ry   rz   r{   rQ   r  r  r   r   r  r  r  rg   r.  ri   ru   r   r6  typingoverloadrA  r  r  r_   r  r[   rZ   r  r  r  r  r  r  r|   rF   rK   rH   r   r   %  sa   "$ &*"$ "	"$
 %'"$ (,"$  "$ !%"$ !%"$ /3"$ "$ "$H 
 
< ! ! . .
 , ,
 G G*
!+Z(@
 %)(@ ((@ (@T __  $ %) (  __  $ %) ( K  $K %)K (K KZ2*; "&	;
 &*; $(; &*; #'; ;z% 	%
 "&% % #'% &*%N1< 


B)
)V% %rK   r   __main__)Panel)Rule)Syntax)r7   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  Nr   TNFN
   r   r   r   r   r  FTr  r  )
__future__r   r  r  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'   r(   typing_extensionsr)   rv  r*   r+   r   r,   r-   r.   r/   r  r0   jupyterr1   r]   r2   progress_barr3   r  r4   r   r5   r  r6   r7   r  r8   r9   r   r:   r;   rE   r9  r<   r>   r   r   r"  r6  r  rA  rJ  rk  ry  r   r   r  r   r   r  r  r   r5  r0  r6  r8  r   rw   randomtimepanelr  ruler  syntaxr  r  progress_renderables	itertoolsr)  examplesr  rA   r  task1task2task3r  r_   sleeprandintr  r   rF   rK   rH   <module>rF     s   " 	   #  (  .      * *      , & # B B $ !  %      	3	~&2u9% ^^D&(+%6 %PK
\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M	%| M	%` 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PAP4PP,	