
    ցj|                     ^    S r SSKrSSKJr  SSKJr  SS/0r/ SQr " S	 S
\5      r	S r
\	r\
rg)z
Asynchronous progress bar decorator for iterators.
Includes a default `range` iterator printing to `stderr`.

Usage:
>>> from tqdm.asyncio import trange, tqdm
>>> async for i in trange(10):
...     ...
    N)version_info   )tqdmzgithub.com/	casperdcl)tqdm_asynciotaranger   trangec                   |   ^  \ rS rSrSrSU 4S jjrS rS rS r\	SSSS.S	 j5       r
\	SSSS
S.S j5       rSrU =r$ )r      z(
Asynchronous-friendly version of tqdm.
Nc                   > [         TU ]  " U/UQ70 UD6  SU l        Ub  [        US5      (       a  UR                  U l        SU l        g [        US5      (       a8  UR                  5       U l        U R                  R                  U l        SU l        g [        US5      (       a  UR                  U l        g [        U5      U l        U R                  R                  U l        g g )NF	__anext__T	__aiter____next__)
super__init__iterable_awaitablehasattrr   iterable_nextr   iterable_iteratorr   iter)selfiterableargskwargs	__class__s       F/mnt/workspace/venv-train/lib/python3.13/site-packages/tqdm/asyncio.pyr   tqdm_asyncio.__init__   s    3D3F3"'x--%-%7%7"*.';//)1););)=&%)%;%;%E%E"*.':..%-%6%6")-h&%)%;%;%D%D"      c                     U $ N )r   s    r   r   tqdm_asyncio.__aiter__(   s    r   c                 $  #     U R                   (       a  U R                  5       I S h  vN nOU R                  5       nU R                  5         U$  N'! [         a    U R	                  5         [
        e[         a    U R	                  5         e f = f7fr    )r   r   updateStopIterationcloseStopAsyncIterationBaseException)r   ress     r   r   tqdm_asyncio.__anext__+   sx     	&& ..00((*KKMJ	 1
  	%JJL$$ 	JJL	s,   B$A A&A BA ;BBc                 :    U R                   R                  " U0 UD6$ r    )r   send)r   r   r   s      r   r,   tqdm_asyncio.send:   s    }}!!42622r   looptimeouttotalc             +      #    Uc  [        U5      n0 n[        SS S:  a  X&S'   U " [        R                  " U4SU0UD64SU0UD6 Sh  vN   g N7f)z%
Wrapper for `asyncio.as_completed`.
N   )   
   r/   r0   r1   )lenr   asyncioas_completed)clsfsr/   r0   r1   tqdm_kwargsr   s          r   r8   tqdm_asyncio.as_completed=   si     
 =GEg%!6Nw++BJJ6J 3"3&13 	3 	3s   AA	A
AF)r/   r0   r1   return_exceptionsc                "  ^#    U4S jn[        U5       VV	s/ s H  u  pU" X5      PM     n
nn	U R                  " U
4XUS.UD6 V	s/ s H  oI Sh  vN PM     nn	[        U5       VVs/ s H  u  pUPM	     snn$ s  sn	nf  N0s  sn	f s  snnf 7f)z
Wrapper for `asyncio.gather`.
c                 l   >#     XI S h  vN 4$  N! [          a  nT(       a  X4s S nA$ e S nAff = f7fr    )	Exception)ifer=   s      r   wrap_awaitable+tqdm_asyncio.gather.<locals>.wrap_awaitableP   s3     'z!' $4Ks4   4  4 
1	,14,14r.   N)	enumerater8   sorted)r9   r/   r0   r1   r=   r:   r;   rD   rA   rB   ifsr)   _s       `        r   gathertqdm_asyncio.gatherJ   s     	 1:">~a#> # 0 0 !M47<!M@K!M N !M1ww !M N$Sk*kdak** ? N*s?   BA<B
BB
BB*B	8
BBB)r   r   r   r    )__name__
__module____qualname____firstlineno____doc__r   r   r   r,   classmethodr8   rJ   __static_attributes____classcell__)r   s   @r   r   r      sV    E"3 &*D 
3 
3 $($dV[ + +r   r   c                  &    [        [        U 6 40 UD6$ )z=
A shortcut for `tqdm.asyncio.tqdm(range(*args), **kwargs)`.
)r   range)r   r   s     r   r   r   ^   s     t///r   )rP   r7   sysr   stdr   std_tqdm
__author____all__r   r   r	   r!   r   r   <module>r[      sF      !k]+

7H+8 H+V0 	r   