§
    #ˆtjˆ  ã                  ó´  — U d dl mZ dZd dlZd dlmZ d dlmZ d dlm	Z	m
Z
mZmZmZmZmZ d dlmZ dd	lmZ e	rdd
lmZ  ed¦  «        Z ed¦  «        Zd d„Zd d„Zd d„Ze edd¬¦  «         G d„ d¦  «        ¦   «         ¦   «         Zd!d„Z e¦   «         Zded<    G d„ dej        ¦  «        Z  G d„ dee         ¦  «        Z! G d„ dee         ¦  «        Z"dS )"é    )Úannotations)ÚEventLoopTokenÚRunvarTokenÚRunVarÚ
checkpointÚcheckpoint_if_cancelledÚcancel_shielded_checkpointÚcurrent_tokenN)Ú	dataclass)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚGenericÚLiteralÚTypeVarÚfinalÚoverload)ÚWeakKeyDictionaryé   )Úget_async_backend)ÚAsyncBackendÚTÚDÚreturnÚNonec               ƒ  óV   K  — t          ¦   «                              ¦   «         ƒ d{V —† dS )zò
    Check for cancellation and allow the scheduler to switch to another task.

    Equivalent to (but more efficient than)::

        await checkpoint_if_cancelled()
        await cancel_shielded_checkpoint()

    .. versionadded:: 3.0

    N)r   r   © ó    úL/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/anyio/lowlevel.pyr   r      s8   è è € õ Ñ
Ô
×
(Ò
(Ñ
*Ô
*Ð*Ð*Ð*Ð*Ð*Ð*Ð*Ð*Ð*r   c               ƒ  óV   K  — t          ¦   «                              ¦   «         ƒ d{V —† dS )z°
    Enter a checkpoint if the enclosing cancel scope has been cancelled.

    This does not allow the scheduler to switch to a different task.

    .. versionadded:: 3.0

    N)r   r   r   r   r   r   r   +   s8   è è € õ Ñ
Ô
×
5Ò
5Ñ
7Ô
7Ð7Ð7Ð7Ð7Ð7Ð7Ð7Ð7Ð7r   c               ƒ  óV   K  — t          ¦   «                              ¦   «         ƒ d{V —† dS )zü
    Allow the scheduler to switch to another task but without checking for cancellation.

    Equivalent to (but potentially more efficient than)::

        with CancelScope(shield=True):
            await checkpoint()

    .. versionadded:: 3.0

    N)r   r	   r   r   r   r	   r	   7   s8   è è € õ Ñ
Ô
×
8Ò
8Ñ
:Ô
:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ð:r   TF)ÚfrozenÚreprc                  ó(   — e Zd ZU dZded<   ded<   dS )r   za
    An opaque object that holds a reference to an event loop.

    .. versionadded:: 4.11.0
    ztype[AsyncBackend]Úbackend_classÚobjectÚnative_tokenN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   r   r   r   F   s6   € € € € € € ðð ð &Ð%Ð%Ñ%ØÐÐÑÐÐr   r   c                 óf   — t          ¦   «         } |                      ¦   «         }t          | |¦  «        S )zÿ
    Return a token object that can be used to call code in the current event loop from
    another thread.

    :raises NoEventLoopError: if no supported asynchronous event loop is running in the
        current thread

    .. versionadded:: 4.11.0

    )r   r
   r   )r%   Ú	raw_tokens     r   r
   r
   S   s0   € õ &Ñ'Ô'€MØ×+Ò+Ñ-Ô-€IÝ˜-¨Ñ3Ô3Ð3r   z1WeakKeyDictionary[object, dict[RunVar[Any], Any]]Ú	_run_varsc                  ó,   — e Zd Z ej        ¦   «         ZdS )Ú_NoValueSetN)r(   r)   r*   ÚenumÚautoÚNO_VALUE_SETr   r   r   r1   r1   f   s   € € € € € Ø�4”9‘;”;€L€L€Lr   r1   c                  ó.   — e Zd ZdZdZdd„Zdd
„Zdd„ZdS )r   zù
    A token that can be used to restore a :class:`RunVar` to its previous value.

    Returned by :meth:`RunVar.set`. Can be used as a context manager to automatically
    reset the variable on exit, or passed directly to :meth:`RunVar.reset`.
    ©Ú_varÚ_valueÚ	_redeemedÚvarú	RunVar[T]Úvalueú%T | Literal[_NoValueSet.NO_VALUE_SET]c                ó0   — || _         || _        d| _        d S )NFr6   )Úselfr:   r<   s      r   Ú__init__zRunvarToken.__init__t   s   € ØˆŒ	Ø=BˆŒØˆŒˆˆr   r   úRunvarToken[T]c                ó   — | S ©Nr   ©r?   s    r   Ú	__enter__zRunvarToken.__enter__y   s   € Øˆr   Úexc_typeútype[BaseException] | NoneÚexc_valúBaseException | NoneÚexc_tbúTracebackType | Noner   c                ó:   — | j                              | ¦  «         d S rC   )r7   Úreset)r?   rF   rH   rJ   s       r   Ú__exit__zRunvarToken.__exit__|   s   € ð 	Œ	�Š˜ÑÔÐÐÐr   N)r:   r;   r<   r=   )r   rA   )rF   rG   rH   rI   rJ   rK   r   r   )r(   r)   r*   r+   Ú	__slots__r@   rE   rN   r   r   r   r   r   j   sa   € € € € € ðð ð .€Iðð ð ð ð
ð ð ð ðð ð ð ð ð r   r   c                  ó¨   — e Zd ZU dZdZej        Zded<   efdd	„Ze	dd„¦   «         Z
edd„¦   «         Zedd„¦   «         Zefd d„Zd!d„Zd"d„Zd#d„ZdS )$r   a  
    Like a :class:`~contextvars.ContextVar`, except scoped to the running event loop.

    Can be used as a context manager, Just like :class:`~contextvars.ContextVar`, that
    will reset the variable to its previous value when the context block is exited.
    ©Ú_nameÚ_defaultz!Literal[_NoValueSet.NO_VALUE_SET]r4   ÚnameÚstrÚdefaultr=   c                ó"   — || _         || _        d S rC   rQ   )r?   rT   rV   s      r   r@   zRunVar.__init__‘   s   € ð ˆŒ
ØˆŒˆˆr   r   údict[RunVar[T], T]c                ó€   — t          ¦   «         j        }	 t          |         S # t          $ r i x}t          |<   |cY S w xY wrC   )r
   r'   r/   ÚKeyError)r?   r'   Úrun_varss      r   Ú_current_varszRunVar._current_vars—   sQ   € å$‘”Ô3ˆð	Ý˜\Ô*Ð*øÝð 	ð 	ð 	Ø13Ð3ˆH•y Ñ.ØˆOˆOˆOð	øøøs   •" ¢=¼=r   úT | Dc                ó   — d S rC   r   ©r?   rV   s     r   Úgetz
RunVar.get    s   € Ø(+¨r   r   c                ó   — d S rC   r   rD   s    r   r`   z
RunVar.get£   s   € Ø˜r   ú%D | Literal[_NoValueSet.NO_VALUE_SET]c                óÊ   — 	 | j         |          S # t          $ r1 |t          j        ur|cY S | j        t          j        ur	| j        cY S Y nw xY wt          d| j        › d�¦  «        ‚)a2  
        Return the current value of this run variable.

        :param default: a fallback value to return if no value has been set
        :return: the current value, the provided default, or the variable's own default
        :raises LookupError: if no value is set and no default is available

        zRun variable "z!" has no value and no default set)r\   rZ   r   r4   rS   ÚLookupErrorrR   r_   s     r   r`   z
RunVar.get¦   s‘   € ð	%ØÔ% dÔ+Ð+øÝð 	%ð 	%ð 	%Ø�fÔ1Ð1Ð1Ø���Ø”¥fÔ&9Ð9Ð9Ø”}Ð$Ð$Ð$ð :Ð9ð	%øøøõ ØJ˜TœZÐJÐJÐJñ
ô 
ð 	
s   ‚ �A
«A
Á	A
r<   rA   c                óz   — | j         }t          | |                     | t          j        ¦  «        ¦  «        }||| <   |S )z¾
        Set the value of this run variable for the current event loop.

        :param value: the new value
        :return: a token that can be used to restore the previous value

        )r\   r   r`   r   r4   )r?   r<   Úcurrent_varsÚtokens       r   Úsetz
RunVar.set½   s=   € ð Ô)ˆÝ˜D ,×"2Ò"2°4½Ô9LÑ"MÔ"MÑNÔNˆØ"ˆ�TÑØˆr   rg   r   c                óè   — |j         | urt          d¦  «        ‚|j        rt          d¦  «        ‚|j        t          j        u r	 | j        | = n# t          $ r Y nw xY w|j        | j        | <   d|_        dS )a  
        Restore this run variable to the value it held before the matching :meth:`set`.

        :param token: the token returned by :meth:`set`
        :raises ValueError: if the token belongs to a different :class:`RunVar` or the token
            has already been used

        z)This token does not belong to this RunVarz This token has already been usedTN)r7   Ú
ValueErrorr9   r8   r1   r4   r\   rZ   )r?   rg   s     r   rM   zRunVar.resetÊ   s™   € ð Œ:˜TÐ!Ð!ÝÐHÑIÔIÐIàŒ?ð 	AÝÐ?Ñ@Ô@Ð@àŒ<�;Ô3Ð3Ð3ðØÔ& tÐ,Ð,øÝð ð ð Ø�ðøøøð (-¤|ˆDÔ˜tÑ$àˆŒˆˆs   ÁA Á
AÁAc                ó   — d| j         ›d�S )Nz<RunVar name=ú>)rR   rD   s    r   Ú__repr__zRunVar.__repr__ã   s   € Ø.˜tœzÐ.Ð.Ð.Ð.r   N)rT   rU   rV   r=   )r   rX   )rV   r   r   r]   )r   r   )rV   rb   r   r]   )r<   r   r   rA   )rg   rA   r   r   )r   rU   )r(   r)   r*   r+   rO   r1   r4   r,   r@   Úpropertyr\   r   r`   rh   rM   rm   r   r   r   r   r   …   s  € € € € € € ðð ð $€Ià6AÔ6N€LÐNÐNÐNÑNð KWð ð  ð  ð  ð  ð ðð ð ñ „Xðð Ø+Ð+Ð+ñ „XØ+àØÐÐñ „XØð @Lð
ð 
ð 
ð 
ð 
ð.ð ð ð ðð ð ð ð2/ð /ð /ð /ð /ð /r   r   )r   r   )r   r   )#Ú
__future__r   Ú__all__r2   Údataclassesr   Útypesr   Útypingr   r   r   r   r   r   r   Úweakrefr   Ú_core._eventloopr   Úabcr   r   r   r   r   r	   r   r
   r/   r,   ÚEnumr1   r   r   r   r   r   ú<module>rx      s6  ðØ "Ð "Ð "Ð "Ð "Ð "Ð "ð€ð €€€Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ø QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QØ %Ð %Ð %Ð %Ð %Ð %à /Ð /Ð /Ð /Ð /Ð /àð "Ø!Ð!Ð!Ð!Ð!Ð!à€GˆC�L„L€Ø€GˆC�L„L€ð+ð +ð +ð +ð	8ð 	8ð 	8ð 	8ð;ð ;ð ;ð ;ð Ø
€�$˜UÐ#Ñ#Ô#ðð ð ð ð ñ ô ñ $Ô#ñ „ðð4ð 4ð 4ð 4ð  @QÐ?PÑ?RÔ?R€	Ð RÐ RÐ RÑ Rðð ð ð ð �$”)ñ ô ð ðð ð ð ð �'˜!”*ñ ô ð ð6_/ð _/ð _/ð _/ð _/ˆW�QŒZñ _/ô _/ð _/ð _/ð _/r   