← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/anyio/__pycache__/lowlevel.cpython-312.pyc

115 lines

�

c�bj���t�UddlmZdZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZddlmZdd	lmZe	rdd
lmZe
d�Ze
d�Zdd
�Zdd�Zdd�Zeedd��Gd�d���Zdd�Ze�Zded<Gd�dej>�Z Gd�dee�Z!Gd�dee�Z"y) �)�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�Dc��PK�t�j��d{���y7��w)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)rr���e/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/anyio/lowlevel.pyrrs�����
�
(�
(�
*�*�*���&�$�&c��PK�t�j��d{���y7��w)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)rrrrrrr+s�����
�
5�
5�
7�7�7�rc��PK�t�j��d{���y7��w)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)rr	rrrr	r	7s�����
�
8�
8�
:�:�:�rTF)�frozen�reprc�&�eZdZUdZded<ded<y)rza
    An opaque object that holds a reference to an event loop.

    .. versionadded:: 4.11.0
    ztype[AsyncBackend]�
backend_class�object�native_tokenN)�__name__�
__module__�__qualname__�__doc__�__annotations__rrrrrFs���&�%��rrc�N�t�}|j�}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

    )rr
r)r$�	raw_tokens  rr
r
Ss'��&�'�M��+�+�-�I��-��3�3rz1WeakKeyDictionary[object, dict[RunVar[Any], Any]]�	_run_varsc�.�eZdZej�Zy)�_NoValueSetN)r'r(r)�enum�auto�NO_VALUE_SETrrrr0r0fs���4�9�9�;�Lrr0c�<�eZdZdZdZdd�Zdd�Z								d	d�Zy)
rz�
    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�	_redeemedc�.�||_||_d|_y)NFr5)�self�var�values   r�__init__zRunvarToken.__init__ts����	�=B�����rc��|S�Nr�r:s r�	__enter__zRunvarToken.__enter__ys���rc�:�|jj|�yr?)r6�reset)r:�exc_type�exc_val�exc_tbs    r�__exit__zRunvarToken.__exit__|s��	
�	�	����rN)r;z	RunVar[T]r<�%T | Literal[_NoValueSet.NO_VALUE_SET])�return�RunvarToken[T])rDztype[BaseException] | NonerEzBaseException | NonerFzTracebackType | NonerI�None)r'r(r)r*�	__slots__r=rArGrrrrrjsC���.�I��
��,��&��%�	�

�rrc��eZdZUdZdZejZded<ef			dd�Ze	dd��Z
edd��Zedd��Zef			dd	�Zdd
�Z
dd�Zdd�Zy
)ra
    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]r3c� �||_||_yr?rN)r:�name�defaults   rr=zRunVar.__init__�s����
���
rc�v�t�j}	t|S#t$rix}t|<|cYSwxYwr?)r
r&r.�KeyError)r:r&�run_varss   r�
_current_varszRunVar._current_vars�sB��$��3�3��	��\�*�*���	�13�3�H�y��.��O�	�s��8�8c��yr?r�r:rSs  r�getz
RunVar.get�s��(+rc��yr?rr@s rrZz
RunVar.get�s��rc���	|j|S#t$rC|tjur|cYS|jtjur|jcYSYnwxYwtd|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

        zRun variable "z!" has no value and no default set)rWrUrr3rP�LookupErrorrOrYs  rrZz
RunVar.get�s{��	%��%�%�d�+�+���	%��f�1�1�1������f�&9�&9�9��}�}�$�:�	%����T�Z�Z�L�(I�J�
�	
s��A�(A�Ac�|�|j}t||j|tj��}|||<|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

        )rWrrZrr3)r:r<�current_vars�tokens    r�setz
RunVar.set�s=���)�)���D�,�"2�"2�4��9L�9L�"M�N��"��T���rc�4�|j|urtd��|jrtd��|jtj
ur	|j|=d|_y|j|j|<d|_y#t$r
Yd|_ywxYw)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)r6�
ValueErrorr8r7r0r3rWrU)r:r`s  rrCzRunVar.reset�s����:�:�T�!��H�I�I��?�?��?�@�@��<�<�;�3�3�3�
��&�&�t�,����(-�|�|�D���t�$������
�����
�s�
B�	B�Bc�"�d|j�d�S)Nz
<RunVar name=�>)rOr@s r�__repr__zRunVar.__repr__�s���t�z�z�n�A�.�.rN)rR�strrSrH)rIzdict[RunVar[T], T])rSrrI�T | D)rIr)rSz%D | Literal[_NoValueSet.NO_VALUE_SET]rIrh)r<rrIrJ)r`rJrIrK)rIrg)r'r(r)r*rLr0r3r+r=�propertyrWrrZrarCrfrrrrr�s����$�I�6A�6N�6N�L�3�N�KW� �� �"G� ������+��+�
����@L�
�<�
�	�
�.��2/rr)rIrK)rIr)#�
__future__r�__all__r1�dataclassesr�typesr�typingr
rrrrrr�weakrefr�_core._eventloopr�abcrrrrrr	rr
r.r+�Enumr0rrrrr�<module>rss���"����!��Q�Q�Q�%�/��!��C�L���C�L��+�	8�;��
�$�U�#���$���
4� @Q�?R�	�<�R��$�)�)���'�!�*��6_/�W�Q�Z�_/r