a c+@sddlZddlZddlZddlZddlmZejdkrDddlmZn ddlmZej e dddZ ej dd d Z Gd d d ee ZGd ddeZej deddZGdddejeZdS)N) TracebackType))Protocol)objreturncCs2t|tjr|j}qt|p0t|o0t|jSN) isinstance functoolspartialfuncasyncioiscoroutinefunctioncallable__call__)rr]/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/starlette/_utils.pyis_async_callable s   rT_coT) covariantc@sleZdZejejdefdddZedddZej ej e ej e ej e ej edfddd ZdS) AwaitableOrContextManagerNrcCsdSrrselfrrr __await__"sz#AwaitableOrContextManager.__await__csdSrrrrrr __aenter__%sz$AwaitableOrContextManager.__aenter__)$_AwaitableOrContextManager__exc_type%_AwaitableOrContextManager__exc_value%_AwaitableOrContextManager__tracebackrcsdSrr)rrrrrrr __aexit__(sz#AwaitableOrContextManager.__aexit__)__name__ __module__ __qualname__typing GeneratorAnyrrrOptionalType BaseExceptionrUnionboolrrrrrr!s rc@seZdZddddZdS)SupportsAsyncCloseNrcsdSrrrrrrclose2szSupportsAsyncClose.close)r r!r"r,rrrrr+1sr+SupportsAsyncCloseTypeF)boundrc@sleZdZdZejeddddZejej defdddZ edd d Z ej ej de fd d d ZdS) AwaitableOrContextManagerWrapperawenteredN)r1rcCs ||_dSr)r1)rr1rrr__init__>sz)AwaitableOrContextManagerWrapper.__init__rcCs |jSr)r1rrrrrrAsz*AwaitableOrContextManagerWrapper.__await__cs|jIdH|_|jSrr0rrrrrDsz+AwaitableOrContextManagerWrapper.__aenter__)argsrcs|jIdHdSr)r2r,)rr4rrrrHsz*AwaitableOrContextManagerWrapper.__aexit__)r r!r" __slots__r# Awaitabler-r3r$r%rrr)r*rrrrrr/;s r/)r r sysr#typesr version_infoZtyping_extensionsrr%r*rTypeVarrrr+r-Genericr/rrrrs