HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/.local/lib/python3.10/site-packages/tqdm/__pycache__/asyncio.cpython-310.pyc
o

���g�
�@sZdZddlZddlmZddlmZddgiZgd�ZGd	d
�d
e�Z	dd�Z
e	Ze
ZdS)
z�
Asynchronous progressbar 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�)�tqdmzgithub.com/�	casperdcl)�tqdm_asyncio�taranger�trangecsfeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zedddd�dd
��Z	edddd�dd��Z
�ZS)rz0
    Asynchronous-friendly version of tqdm.
    Ncsvt�j|g|�Ri|��d|_|dur9t|d�r"|j|_d|_dSt|d�r-|j|_dSt|�|_|jj|_dSdS)NF�	__anext__T�__next__)	�super�__init__�iterable_awaitable�hasattrr	�
iterable_nextr
�iter�iterable_iterator)�self�iterable�args�kwargs��	__class__��?/home/arjun/.local/lib/python3.10/site-packages/tqdm/asyncio.pyrs



�ztqdm_asyncio.__init__cCs|S�Nr)rrrr�	__aiter__$sztqdm_asyncio.__aiter__c�s`�z|jr
|��IdH}n|��}|��|WSty$|��t�ty/|���wr)r
r�update�
StopIteration�close�StopAsyncIteration�
BaseException)r�resrrrr	's��ztqdm_asyncio.__anext__cOs|jj|i|��Sr)r�send)rrrrrrr"6sztqdm_asyncio.send��loop�timeout�totalcks^�|dur	t|�}i}tdd�dkr||d<|tj|fd|i|��fd|i|��EdHdS)z5
        Wrapper for `asyncio.as_completed`.
        N�)��
r$r%r&)�lenr�asyncio�as_completed)�cls�fsr$r%r&�tqdm_kwargsrrrrr,9s���ztqdm_asyncio.as_completedc�s\�dd���fdd�t|�D�}dd�|j|f|||d�|��D�IdH}dd�t|�D�S)	z/
        Wrapper for `asyncio.gather`.
        c�s�||IdHfSrr)�i�frrr�wrap_awaitableKs�z+tqdm_asyncio.gather.<locals>.wrap_awaitablecsg|]	\}}�||��qSrr)�.0r0r1�r2rr�
<listcomp>Nsz'tqdm_asyncio.gather.<locals>.<listcomp>c�s�g|]}|IdH�qSrr)r3r1rrrr5Os�r#NcSsg|]\}}|�qSrr)r3�_r0rrrr5Qs)�	enumerater,�sorted)r-r$r%r&r.r/�ifsr!rr4r�gatherFs���ztqdm_asyncio.gatherr)�__name__�
__module__�__qualname__�__doc__rrr	r"�classmethodr,r:�
__classcell__rrrrrs
rcOstt|�fi|��S)zE
    A shortcut for `tqdm.asyncio.tqdm(range(*args), **kwargs)`.
    )r�range)rrrrrrTsr)r>r+�sysr�stdr�std_tqdm�
__author__�__all__rrrrrrr�<module>s	
A