
    b?i                         S SK Jr  S SKrS rS r " S S\5      r " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      r	 " S S\5      r
 " S S5      rg)    )	CoroutineNc                 6    [         R                  " SU 5      S S $ )N<I   )structpack)ns    R/var/www/html/livechat/backend/venv/lib/python3.13/site-packages/aiomysql/utils.py_pack_int24r      s    ;;tQ##    c                 4   U S:  a  [        SU -  5      eU S:  a  [        U /5      $ U S:  a  S[        R                  " SU 5      -   $ U S:  a  S[        R                  " S	U 5      S S
 -   $ U S:  a  S[        R                  " SU 5      -   $ [        SU S4-  5      e)Nr   zFEncoding %d is less than 0 - no representation in LengthEncodedInteger   i      z<Hi      r   r   l               z<QzIEncoding %x is larger than %x - no representation in LengthEncodedInteger)
ValueErrorbytesr   r   )is    r
   _lenenc_intr   
   s    1uTWXX
 	
 
TaSz	
gT1---	
gT1-bq111	
gT1---W7n
 	
r   c                       \ rS rSrSrS rS rSS jrS r\	S 5       r
\	S	 5       r\	S
 5       rS rS rS rS rS rSrg)_ContextManager   _coro_objc                     Xl         S U l        g Nr   )selfcoros     r
   __init___ContextManager.__init__"   s    
	r   c                 8    U R                   R                  U5      $ r   )r   send)r   values     r
   r#   _ContextManager.send&   s    zzu%%r   Nc                     Uc  U R                   R                  U5      $ Uc  U R                   R                  X5      $ U R                   R                  XU5      $ r   )r   throw)r   typvaltbs       r
   r'   _ContextManager.throw)   sM    ;::##C((Z::##C--::##Cb11r   c                 6    U R                   R                  5       $ r   )r   closer   s    r
   r-   _ContextManager.close1   s    zz!!r   c                 .    U R                   R                  $ r   )r   gi_framer.   s    r
   r1   _ContextManager.gi_frame4   s    zz"""r   c                 .    U R                   R                  $ r   )r   
gi_runningr.   s    r
   r4   _ContextManager.gi_running8   s    zz$$$r   c                 .    U R                   R                  $ r   )r   gi_coder.   s    r
   r7   _ContextManager.gi_code<   s    zz!!!r   c                 $    U R                  S 5      $ r   )r#   r.   s    r
   __next___ContextManager.__next__@   s    yyr   c                 6    U R                   R                  5       $ r   r   	__await__r.   s    r
   __iter___ContextManager.__iter__C       zz##%%r   c                 6    U R                   R                  5       $ r   r=   r.   s    r
   r>   _ContextManager.__await__F   rA   r   c                 X   #    U R                   I S h  vN U l        U R                  $  N7fr   r   r.   s    r
   
__aenter___ContextManager.__aenter__I   s"     **$	yy %   *(*c                 b   #    U R                   R                  5       I S h  vN   S U l         g  N7fr   )r   r-   r   exc_typeexcr*   s       r
   	__aexit___ContextManager.__aexit__M   s%     iioo	 	 s   /-/)NN)__name__
__module____qualname____firstlineno__	__slots__r    r#   r'   r-   propertyr1   r4   r7   r:   r?   r>   rE   rL   __static_attributes__ r   r
   r   r      sp    !I&2" # # % % " "&&r   r   c                       \ rS rSrS rSrg)_ConnectionContextManagerR   c                    #    Ub  U R                   R                  5         O"U R                   R                  5       I S h  vN   S U l         g  N7fr   )r   r-   ensure_closedrI   s       r
   rL   #_ConnectionContextManager.__aexit__S   s;     IIOO))))+++	 ,s   <AAAr   NrN   rO   rP   rQ   rL   rT   rU   r   r
   rW   rW   R   s    r   rW   c                       \ rS rSrS rSrg)_PoolContextManager[   c                    #    U R                   R                  5         U R                   R                  5       I S h  vN   S U l         g  N7fr   )r   r-   wait_closedrI   s       r
   rL   _PoolContextManager.__aexit__\   s5     		ii##%%%	 	&s   8A	AA	r\   Nr]   rU   r   r
   r_   r_   [   s    r   r_   c                        \ rS rSrS rS rSrg)_SAConnectionContextManagerb   c                     U $ r   rU   r.   s    r
   	__aiter__%_SAConnectionContextManager.__aiter__c   s    r   c                   #    U R                   c  U R                  I S h  vN U l          U R                   R                  5       I S h  vN $  N, N! [         a,    U R                   R	                  5       I S h  vN    S U l         e f = f7fr   )r   r   	__anext__StopAsyncIterationr-   r.   s    r
   rk   %_SAConnectionContextManager.__anext__f   sn     99"jj(DI	,,... ) /! 	))//###DI	sD   B	A	B	A AA B	A 'B7A:8BB	r\   N)rN   rO   rP   rQ   rh   rk   rT   rU   r   r
   re   re   b   s    	r   re   c                       \ rS rSrS rSrg)_TransactionContextManagerr   c                    #    U(       a#  U R                   R                  5       I S h  vN   O=U R                   R                  (       a"  U R                   R                  5       I S h  vN   S U l         g  NJ N7fr   )r   rollback	is_activecommitrI   s       r
   rL   $_TransactionContextManager.__aexit__s   sR     ))$$&&&yy""ii&&(((		 ' )s!   %A6A2=A6%A4&A64A6r\   Nr]   rU   r   r
   ro   ro   r   s    r   ro   c                   *    \ rS rSrSrS rS rS rSrg)_PoolAcquireContextManager|   r   _conn_poolc                 *    Xl         S U l        X l        g r   ry   )r   r   pools      r
   r    #_PoolAcquireContextManager.__init__   s    


r   c                 X   #    U R                   I S h  vN U l        U R                  $  N7fr   )r   rz   r.   s    r
   rE   %_PoolAcquireContextManager.__aenter__   s"     ::%
zz &rG   c                    #     U R                   R                  U R                  5      I S h  vN   S U l         S U l        g  N! S U l         S U l        f = f7fr   r{   releaserz   rI   s       r
   rL   $_PoolAcquireContextManager.__aexit__   H     	**$$TZZ000DJDJ 1DJDJ+   A(A A A A A AA)rz   r   r{   N)	rN   rO   rP   rQ   rR   r    rE   rL   rT   rU   r   r
   rw   rw   |   s    +I
r   rw   c                   :    \ rS rSrSrSrS rS rS rS r	S r
S	rg
)_PoolConnectionContextManager   a  Context manager.

This enables the following idiom for acquiring and releasing a
connection around a block:

    with (yield from pool) as conn:
        cur = yield from conn.cursor()

while failing loudly when accidentally using:

    with pool:
        <block>
r{   rz   c                     Xl         X l        g r   r   )r   r}   conns      r
   r    &_PoolConnectionContextManager.__init__   s    

r   c                 @    U R                   (       d   eU R                   $ r   )rz   r.   s    r
   	__enter__'_PoolConnectionContextManager.__enter__   s    zzzzzr   c                      U R                   R                  U R                  5        S U l         S U l        g ! S U l         S U l        f = fr   r   r   rJ   exc_valexc_tbs       r
   __exit__&_PoolConnectionContextManager.__exit__   s=    	JJtzz*DJDJ DJDJs	   %6 Ac                    #    U R                   (       a   eU R                  R                  5       I S h  vN U l         U R                   $  N7fr   )rz   r{   acquirer.   s    r
   rE   (_PoolConnectionContextManager.__aenter__   s7     ::~::--//
zz 0s   1AA	Ac                    #     U R                   R                  U R                  5      I S h  vN   S U l         S U l        g  N! S U l         S U l        f = f7fr   r   r   s       r
   rL   '_PoolConnectionContextManager.__aexit__   r   r   )rz   r{   N)rN   rO   rP   rQ   __doc__rR   r    r   r   rE   rL   rT   rU   r   r
   r   r      s'     #I
r   r   )collections.abcr   r   r   r   r   rW   r_   re   ro   rw   r   rU   r   r
   <module>r      sh    % $
(1i 1h / /    ** *r   