ó
    Ñ]jÒ#  ã                  óŒ  • S SK Jr  S SKrS SKJr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKJr  S S	KJr  S S
KJr  S SKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  \" S5      r\R                  (       a   " S S\5      rS/S jrOS SKJr  S SKJr  \" \" 5       S5      rS0S jr " S S\5      r \" SS S!9r!\(       a
      S1S" jr"O\RD                  r"S2S# jr#S3S$ jr$S4S% jr%S4S& jr&S'S(.         S5S) jjr' " S* S+5      r(S6S, jr)\(       d  \(       a  \RT                  r+g " S- S.5      r+g)7é    )ÚannotationsN)ÚContext)ÚAny)Ú	Awaitable)ÚCallable)Ú	Coroutine)ÚOptional)ÚTYPE_CHECKING)ÚTypeVar)ÚUnioné   )Úmemoized_propertyé   )Úexc)Úpy311)ÚLiteral)ÚProtocol)ÚSelf)Ú	TypeGuardÚ_Tc                  óH   • \ rS rSr% S\S'   S\S'   SS jrSS jrSS jrS	rg
)Úgreenleté$   ÚboolÚdeadzOptional[Context]Ú
gr_contextc                ó   • g ©N© ©ÚselfÚfnÚdrivers      Ú^/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sqlalchemy/util/_concurrency_py3k.pyÚ__init__Úgreenlet.__init__(   s   € Àcó    c                ó   • g r   r   )r!   Úargs     r$   ÚthrowÚgreenlet.throw*   ó   € Ør'   c                ó   • g r   r   )r!   Úvalues     r$   ÚswitchÚgreenlet.switch-   r,   r'   r   N©r"   zCallable[..., Any]r#   r   )r)   r   Úreturnr   )r.   r   r2   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__r%   r*   r/   Ú__static_attributes__r   r'   r$   r   r   $   s   ‡ Ø‹
Ø%Ó%äIô	÷	r'   r   c                 ó   • g r   r   r   r'   r$   Ú
getcurrentr:   0   s   €  #r'   )r:   )r   r   c                óŽ   • [        U [        5      (       + =(       d*    [        U [        R                  [        R                  45      $ r   )Ú
isinstanceÚ	ExceptionÚasyncioÚTimeoutErrorÚCancelledError)Úes    r$   Úis_exit_exceptionrB   =   s8   € ô ˜!œYÓ'Ô'÷ ¬:Ø	ŒG× Ñ ¤'×"8Ñ"8Ð9ó,ð r'   c                  ó.   • \ rS rSr% S\S'   SrSS jrSrg)	Ú_AsyncIoGreenletéJ   r   r   Tc                ól   • [         R                  " XU5        [        (       a  UR                  U l        g g r   )r   r%   Ú_has_gr_contextr   r    s      r$   r%   Ú_AsyncIoGreenlet.__init__O   s)   € Ü×Ò˜$ FÔ+ßŠ?Ø$×/Ñ/ˆD�Oð r'   )r   Nr1   )r3   r4   r5   r6   r7   Ú __sqlalchemy_greenlet_provider__r%   r8   r   r'   r$   rD   rD   J   s   ‡ Ø
ƒJà'+Ð$÷0r'   rD   Ú_T_coT)Ú	covariantc                ó   • g r   r   ©Ú	awaitables    r$   ÚiscoroutinerO   Y   s   € à03r'   c                óF   • [        U 5      (       a  U R                  5         g g r   )rO   ÚcloserM   s    r$   Ú_safe_cancel_awaitablerR   a   s   € ô �9×ÑØ�‰Õð r'   c                 ó0   • [        5       n [        U SS5      $ )NrI   F)r:   Úgetattr)Úcurrents    r$   Úin_greenletrV   h   s   € Ü‹l€GÜ�7Ð>ÀÓFÐFr'   c                ó²   • [        5       n[        USS5      (       d!  [        U 5        [        R                  " S5      eUR
                  R                  U 5      $ )zÃAwaits an async function in a sync method.

The sync method must be inside a :func:`greenlet_spawn` context.
:func:`await_only` calls cannot be nested.

:param awaitable: The coroutine to call.

rI   Fzjgreenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place?)r:   rT   rR   r   ÚMissingGreenletÚparentr/   )rN   rU   s     r$   Ú
await_onlyrZ   m   sR   € ô ‹l€GÜ�7Ð>À×FÑFÜ˜yÔ)ä×!Ò!ð=ó
ð 	
ð �>‰>× Ñ  Ó+Ð+r'   c                ó  • [        5       n[        USS5      (       dQ  [        5       nUR                  5       (       a!  [	        U 5        [
        R                  " S5      eUR                  U 5      $ UR                  R                  U 5      $ )aÉ  Awaits an async function in a sync method.

The sync method must be inside a :func:`greenlet_spawn` context.
:func:`await_fallback` calls cannot be nested.

:param awaitable: The coroutine to call.

.. deprecated:: 2.0.24 The ``await_fallback()`` function will be removed
   in SQLAlchemy 2.1.  Use :func:`_util.await_only` instead, running the
   function / program / etc. within a top-level greenlet that is set up
   using :func:`_util.greenlet_spawn`.

rI   Fz˜greenlet_spawn has not been called and asyncio event loop is already running; can't call await_fallback() here. Was IO attempted in an unexpected place?)
r:   rT   Úget_event_loopÚ
is_runningrR   r   rX   Úrun_until_completerY   r/   )rN   rU   Úloops      r$   Úawait_fallbackr`   ‡   sx   € ô  ‹l€GÜ�7Ð>À×FÑFÜÓˆØ�?‰?×ÑÜ" 9Ô-ä×%Ò%ð;óð ð
 ×&Ñ& yÓ1Ð1à�>‰>× Ñ  Ó+Ð+r'   F)Ú_require_awaitc             �  ó’  #   • [        U [        5       5      nSnUR                  " U0 UD6nUR                  (       d1  Sn UI Sh  v•N nUR                  U5      nUR                  (       d  M1  U(       a  U(       d  [        R                  " S5      eU$  NN! [         a%    UR
                  " [        R                  " 5       6 n Nif = f7f)a/  Runs a sync function ``fn`` in a new greenlet.

The sync function can then use :func:`await_only` to wait for async
functions.

:param fn: The sync callable to call.
:param \*args: Positional arguments to pass to the ``fn`` callable.
:param \*\*kwargs: Keyword arguments to pass to the ``fn`` callable.
FTNz¶The current operation required an async execution but none was detected. This will usually happen when using a non compatible DBAPI driver. Please ensure that an async DBAPI is used.)
rD   r:   r/   r   ÚBaseExceptionr*   ÚsysÚexc_infor   ÚAwaitRequired)r"   ra   ÚargsÚkwargsÚcontextÚswitch_occurredÚresultr.   s           r$   Úgreenlet_spawnrl   §   s´   é € ô" ˜r¤:£<Ó0€Gð
 €OØ�^Š^˜TÐ, VÑ,€FØ�l�lØˆð
	+ð !—LˆEð —^‘^ EÓ*ˆFð �l�l‰lö žoÜ×ÒðGó
ð 	
ð
 €Mñ !øÜó 	4ð —]’]¤C§L¢L£NÐ3ŠFð		4üs@   ‚<C¿B ÁBÁB Á	"CÁ-&CÂB Â,CÃCÃCÃCc                  ó<   • \ rS rSr\SS j5       rSS jrS	S jrSrg)
ÚAsyncAdaptedLockéÖ   c                ó,   • [         R                  " 5       $ r   )r>   ÚLock©r!   s    r$   ÚmutexÚAsyncAdaptedLock.mutex×   s   € ô �|Š|‹~Ðr'   c                óH   • [        U R                  R                  5       5      $ r   )r`   rs   Úacquirerr   s    r$   Ú	__enter__ÚAsyncAdaptedLock.__enter__Ý   s   € ô ˜dŸj™j×0Ñ0Ó2Ó3Ð3r'   c                ó8   • U R                   R                  5         g r   )rs   Úrelease)r!   r)   Úkws      r$   Ú__exit__ÚAsyncAdaptedLock.__exit__â   s   € Ø�
‰
×ÑÕr'   r   N)r2   zasyncio.Lock©r2   r   )r)   r   r{   r   r2   ÚNone)	r3   r4   r5   r6   r   rs   rw   r|   r8   r   r'   r$   rn   rn   Ö   s   † Øóó ðô
4÷
r'   rn   c                 ó”   •  [         R                  " 5       $ ! [         a     Of = f[         R                  " 5       R	                  5       $ )zuvendor asyncio.get_event_loop() for python 3.7 and above.

Python 3.10 deprecates get_event_loop() as a standalone.

)r>   Úget_running_loopÚRuntimeErrorÚget_event_loop_policyr\   r   r'   r$   r\   r\   æ   sB   € ðÜ×'Ò'Ó)Ð)øÜó áðúô ×(Ò(Ó*×9Ñ9Ó;Ð;s   ‚ —
$£$c                  ój   • \ rS rSr% SrS\S'   SS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSS jrSrg)Ú_Runneréø   z#Runner implementation for test onlyz6Union[None, asyncio.AbstractEventLoop, Literal[False]]Ú_loopc                ó   • S U l         g r   ©r‡   rr   s    r$   r%   Ú_Runner.__init__ý   s	   € ØˆD�Jr'   c                ó&   • U R                  5         U $ r   )Ú
_lazy_initrr   s    r$   rw   Ú_Runner.__enter__   s   € Ø�O‰OÔØˆKr'   c                ó$   • U R                  5         g r   )rQ   )r!   Úexc_typeÚexc_valÚexc_tbs       r$   r|   Ú_Runner.__exit__  s   € Ø�J‰J�Lr'   c                ó  • U R                   (       aV   U R                   R                  U R                   R                  5       5        U R                   R                  5         SU l         g g ! U R                   R                  5         SU l         f = f)NF)r‡   r^   Úshutdown_asyncgensrQ   rr   s    r$   rQ   Ú_Runner.close  si   € Ø�z�zð'Ø—J‘J×1Ñ1ØŸ
™
×5Ñ5Ó7ôð —J‘J×$Ñ$Ô&Ø!&�D•Jð øð —J‘J×$Ñ$Ô&Ø!&�D•Jús   “3A) Á)#Bc                ó`   • U R                  5         U R                  (       d   eU R                  $ )zReturn embedded event loop.)rŒ   r‡   rr   s    r$   Úget_loopÚ_Runner.get_loop  s"   € à�O‰OÔØ—:—:Ð�:Ø—:‘:Ðr'   c                ó~   • U R                  5         U R                  (       d   eU R                  R                  U5      $ r   )rŒ   r‡   r^   )r!   Úcoros     r$   ÚrunÚ_Runner.run  s-   € Ø�O‰OÔØ—:—:Ð�:Ø—:‘:×0Ñ0°Ó6Ð6r'   c                óˆ   • U R                   SL a  [        S5      eU R                   c  [        R                  " 5       U l         g g )NFzRunner is closed)r‡   r‚   r>   Únew_event_looprr   s    r$   rŒ   Ú_Runner._lazy_init  s9   € Ø�z‰z˜UÒ"Ü"Ð#5Ó6Ð6Ø�z‰zÑ!Ü$×3Ò3Ó5�•
ð "r'   r‰   N)r2   r   )r2   r   )r�   r   r�   r   r‘   r   r2   r   ©r2   zasyncio.AbstractEventLoop)rš   zCoroutine[Any, Any, _T]r2   r   )r3   r4   r5   r6   Ú__doc__r7   r%   rw   r|   rQ   r—   r›   rŒ   r8   r   r'   r$   r…   r…   ø   s.   ‡ Ù1àEÓEô	ô	ô	ô	'ô	ô	7÷
	6r'   r…   )r2   r   )rA   rc   r2   r   )rN   zAwaitable[_T_co]r2   z%TypeGuard[Coroutine[Any, Any, _T_co]])rN   zAwaitable[Any]r2   r   r~   )rN   zAwaitable[_T]r2   r   )
r"   zCallable[..., _T]rg   r   ra   r   rh   r   r2   r   r    ),Ú
__future__r   r>   Úcontextvarsr   rd   Útypingr   r   r   r   r	   r
   r   r   Úlanghelpersr   Ú r   Úutilr   Úutil.typingr   r   r   r   r   r   r:   ÚhasattrrG   rB   rD   rJ   rO   rR   rV   rZ   r`   rl   rn   r\   ÚRunnerr…   r   r'   r$   Ú<module>r«      s:  ðõ #ã Ý Û 
Û Ý Ý Ý Ý Ý Ý  Ý Ý å *Ý Ý Ý !Ý "Ý Ý #áˆTƒ]€à	××ô
�8ô 
õ &õ $Ý!ñ ™*›,¨Ó5€ôô0�xô 0ñ 	� 4Ñ(€æð4Ø#ð4à	.õ4ð
 ×%Ñ%€KôôGô
,ô4,ðF !ñ,Øð,àð,ð ð,ð ð	,ð
 õ,÷^ñ ô <ö žØ�n‰n�G÷(6ò (6r'   