Your IP : 3.147.78.249


Current Path : /opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/async_utils.cpython-37.pyc

B

F��a��	@s�ddlZddlZddlmZddlmZddlmZe�d�Z	dd�Z
eee
eeeeed�hZejejddfdd	�d
d�Zdd
d�dd�Zdejdd	�dd�ZdS)�N)�wraps�)�_PassArg)�pass_eval_context�Vcs�fdd�}|S)Ncsrt���}|dk�|tjkr0tjtd�dd��ntjtd�dd��t������fdd��}�rht|�}d|_|S)N)�args�returncSst�t|dj�S)Nr)�t�cast�bool�is_async)r�r
�C/opt/alt/python37/lib/python3.7/site-packages/jinja2/async_utils.pyrsz2async_variant.<locals>.decorator.<locals>.is_asynccSst�t|djj�S)Nr)r	r
r�environmentr)rr
r
rrscs0�|�}�r|dd�}|r&�||�S�||�S)Nrr
)r�kwargs�b)�
async_funcr�need_eval_context�normal_funcr
r�wrappers
z1async_variant.<locals>.decorator.<locals>.wrapperT)	rZfrom_objrr	�AnyrrrZjinja_async_variant)rZpass_argr)r)rrrr�	decorators

z async_variant.<locals>.decoratorr
)rrr
)rr�
async_variants r)�valuerc�s@t|�tkrt�d|�St�|�r4t�d|�IdHSt�d|�S)Nrzt.Awaitable[V])�type�_common_primitivesr	r
�inspect�isawaitable)rr
r
r�
auto_await2s

rz*t.Union[t.AsyncIterable[V], t.Iterable[V]]zt.AsyncIterator[V])�iterablerc	Csft|d�rFxVt�d|�2y3dH}Wn
tk
s8X|VqYWnxt�d|�D]
}|VqTWdS)N�	__aiter__zt.AsyncIterable[V]z
t.Iterable[V])�hasattrr	r
�StopAsyncIteration)r�itemr
r
r�
auto_aiter=s

&r$c�sdd�t|�2�IdHS)Nc
�s.g|y3dH}Wn
tk
s"X|�qYS)N)r")�.0�xr
r
r�
<listcomp>Ksz auto_to_list.<locals>.<listcomp>)r$)rr
r
r�auto_to_listHsr()r�typingr	�	functoolsr�utilsrr�TypeVarrr�int�floatr�str�list�dict�tuplerr�Union�	Awaitablerr$�Listr(r
r
r
r�<module>s
$ 


?>