AlkantarClanX12

Your IP : 3.133.144.147


Current Path : /proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/typing.cpython-311.pyc

�

c��fw���`�dZddlmZmZddlZddlmZddlZddlZddlZddl	Z	ddl
ZddlZddl
Z
ddlZddl
mZmZmZmZ	ddlmZn#e$rd�ZYnwxYwgd�Zd�d	d
�d�Zd�d	d
�d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd	d�d�Zd�Z d�Z!d�Z"d�Z#gZ$d�d	d�d�Z%e&��fd�Z'Gd�d��Z(Gd�d ��Z)Gd!�d"��Z*Gd#�d$e(e*d�%��Z+Gd&�d'e+d�%��Z,Gd(�d)e-��Z.Gd*�d+e.�,��Z/e+d-���Z0e+d.���Z1e+d/���Z2e+d0���Z3e+d1���Z4e+d2���Z5e+d3���Z6e+d4���Z7e,e%d���d5�����Z8e+d6���Z9e+d7���Z:e+d8���Z;Gd9�d:e(d�%��Z<d;e/d<e=fd=�Z>d;e/d<e=fd>�Z?Gd?�d@��Z@GdA�dB��ZAGdC�dDe(e)eAe@d�%��ZBGdE�dFe(e)e@d�%��ZCGdG�dHe(e)d�%��ZDGdI�dJe(e)d�%��ZEGdK�dLe(e)eAe@d�%��ZFdM�ZGGdN�dOe(d�%��ZHGdP�dQeHd�%��ZIGdR�dSe*eHd�%��ZJGdT�dUe*eId�%��ZKGdV�dWeJd�%��ZLGdX�dYeJd�%��ZMGdZ�d[e*eId�%��ZNd\�ZOGd]�d^eId�%��ZPGd_�d`eId�%��ZQe+da���ZRGdb�dceId�%��ZSGdd�de��ZTGdf�dg��ZUgdh�ZVgdi�ZWeVeWzdjgzZXdk�ZYdl�ZZdm�Z[d�dp�Z\d�dr�Z]gds�dtdugdv�Z^Gdw�dxe��Z_Gdy�dzeTe_�,��Z`Gd{�d|e*eId�%��ZaGd}�d~��Zbd�Zcd��Zdd��Zee
jfe
jge
jhe
jieeefZjd�d��Zkd��Zld��Zmd��Znd��Zod�Zpd�e1d<e1fd��Zqd��Zrd��Zsd��Zteejueev����Zwd��Zxd��Zyd��Zzd��Z{eBd���Z|eBd���Z}eBd���Z~eBd�d����ZeBd�d����Z�eBd�d����Z�eBd�d����Z�eBd�de-����Z�eBd�e�e���Z�eJZ�e�ejj�d��Z�e�ejj�dn��Z�e�ejj�dq��Z�e�ejj�dn��Z�e�ejj�dn��Z�e�ejj�dn��Z�e�ejj�dn��Z�e�ejj�dn��Z�e�ejj�d��Z�e�ejj�dn��Z�e�ejj�dn��Z�eLejj�d���Z�d�e�_e�ejj�dnd�����Z�e�ejj�dn��Z�e�ejj�d���Z�e�ejj�d���Z�e�ejj�dn��Z�e�ejj�dn��Z�e�ejj�d��Z�eMe�d�d	d�����Z�d�e�_e�e�dnd	d�����Z�e�ej�dnd�����Z�e�e�dnd	d�����Z�e�e&dnd	d�����Z�e�ejj�dn��Z�e�ejj�dn��Z�e�ejj�d���Z�e�ejj�dn��Z�e�ej�dnd�����Z�e�ej�dnd�����Z�e�evd�d	d�����Z�e�ejd�d�����Z�e�ej�d���Z�e�ej�dn��Z�e�ej�d���Z�e�ejj�dq��Z�e�ejj�d���Z�e�e-dnd	d�����Z�d�e�_ecGd��d�e`����Z�ecGd��d�e`����Z�ecGd��d�e`����Z�ecGd��d�e`����Z�ecGd��d�e`����Z�ecGd��d�e`e����Z�ecGd��d�e`e����Z�d�d��Z�e&hd����Z�e&hd����Z�Gd��d�e-��Z�d�dÄZ�e-��e�d�d�i��Z�dńZ�e�e�_�GdƄd�e-��Z�d�ddȜdɄZ�e-��e�d�d�i��Z�d˄e�_�e+d̄��Z�e+d̈́��Z�Gd΄dϦ�Z�e�Z�d	Z�GdЄd�eTe���Z�Gd҄d�e�e���Z�GdԄd�e�e���Z�Gdքd�e-��Z�Gd؄d�eϬ,��Z�e�d�ze�_�e�ej�e�j�<e�ej�dn��Z�e�ej�dn��Z�Gdۄd�eϬ,��Z
e�d�ze
_�e
ej�e
j�<d�e|d<e|fd߄Z�dd	d	d�d�d�e=d�e=d�e=d�e�e-e/e�d�e/fzd�fd�e/d<e�e|ge|ffd�Z�dS)�a
The typing module: Support for gradual typing as defined by PEP 484 and subsequent PEPs.

Among other things, the module includes the following:
* Generic, Protocol, and internal machinery to support generic aliases.
  All subscripted types like X[int], Union[int, str] are generic aliases.
* Various "special forms" that have unique meanings in type annotations:
  NoReturn, Never, ClassVar, Self, Concatenate, Unpack, and others.
* Classes whose instances can be type arguments to generic classes and functions:
  TypeVar, ParamSpec, TypeVarTuple.
* Public helper functions: get_type_hints, overload, cast, final, and others.
* Several protocols to support duck-typing:
  SupportsFloat, SupportsIndex, SupportsAbs, and others.
* Special types: NewType, NamedTuple, TypedDict.
* Deprecated wrapper submodules for re and io related types.
* Deprecated aliases for builtin types and collections.abc ABCs.

Any name not present in __all__ is an implementation detail
that may be changed without notice. Use at your own risk!
�)�abstractmethod�ABCMetaN)�defaultdict)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�GenericAlias)�_idfuncc��|S�N�)�_�xs  �-/opt/alt/python311/lib64/python3.11/typing.pyr
r
's����)a�	Annotated�Any�Callable�ClassVar�Concatenate�Final�
ForwardRef�Generic�Literal�Optional�	ParamSpec�Protocol�Tuple�Type�TypeVar�TypeVarTuple�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�BinaryIO�IO�Match�Pattern�TextIO�AnyStr�assert_type�assert_never�cast�clear_overloads�dataclass_transform�final�get_args�
get_origin�
get_overloads�get_type_hints�is_typeddict�
LiteralString�Never�NewType�
no_type_check�no_type_check_decorator�NoReturn�NotRequired�overload�
ParamSpecArgs�ParamSpecKwargs�Required�reveal_type�runtime_checkable�Self�Text�
TYPE_CHECKING�	TypeAlias�	TypeGuard�UnpackF��allow_special_formsc�v�|�td��St|t��rt|||���S|S)z=For converting None to type(None), and strings to ForwardRef.N)�module�is_class)�type�
isinstance�strr)�argrvrts   r�
_type_convertr|�sA��
�{��D�z�z���#�s���L��#�f�7J�K�K�K�K��JrTc��ttf}|s|tfz
}|r|tfz
}t	|||���}t|t��r|j|vrt|�d����|ttttttfvr|S|r|ttfvr|St|t��s|ttfvrtd|�d����t!|��t"urt|�d|d�d����|S)a�Check that the argument is a type, and return it (internal helper).

    As a special case, accept None and return type(None) instead. Also wrap strings
    into ForwardRef instances. Consider several corner cases, for example plain
    special forms like Union are not valid, while Union[int, str] is OK, etc.
    The msg argument is a human-readable error message, e.g.::

        "Union[arg, ...]: arg should be a type."

    We append the repr() of the actual value (truncated to 100 chars).
    )rvrt� is not valid as type argumentzPlain z Got z.100�.)rrrrr|ry�
_GenericAlias�
__origin__�	TypeErrorrr`rerarmrp�_SpecialFormrx�tuple)r{�msg�is_argumentrvrt�invalid_generic_formss      r�_type_checkr��s3��%�h�/���.��(��,���	.�!�e�X�-�!�
��F�@S�
T�
T�
T�C��3�
�&�&�@��N�3�3�3��3�>�>�>�?�?�?�
�s�M�8�U�D�)�D�D�D��
���s�x��&7�7�7��
��#�|�$�$�F����/B�(B�(B��D��D�D�D�E�E�E��C�y�y�E����3�2�2�S�2�2�2�2�3�3�3��Jrc�Z�|dup't|ttttf��S)N.)ryr��listr�_ConcatenateGenericAlias)r{s r�_is_param_exprr��s2���#�:�@��C�
�D�)�%=�>�@�@�@rc��|jtjjuo(t	|��dkot|d��S)aCInternal helper for munging collections.abc.Callable's __args__.

    The canonical representation for a Callable's __args__ flattens the
    argument types, see https://github.com/python/cpython/issues/86361.

    For example::

        >>> import collections.abc
        >>> P = ParamSpec('P')
        >>> collections.abc.Callable[[int, int], str].__args__ == (int, int, str)
        True
        >>> collections.abc.Callable[P, str].__args__ == (P, str)
        True

    As a result, if we need to reconstruct the Callable from its __args__,
    we need to unflatten it.
    �r)r��collections�abcr�lenr�)�typ�argss  r�_should_unflatten_callable_argsr��s>��&	��+�/�2�2�	=��T���a��;�N�4��7�$;�$;�<�rc�0�t|tj��rt|��St|t��r#|jdkr|jS|j�d|j��S|durdSt|tj��r|jSt|��S)a;Return the repr() of an object, special-casing types (internal helper).

    If obj is a type, we return a shorter version than the default
    type.__repr__, based on the module and qualified name, which is
    typically enough to uniquely identify a type.  For everything
    else, we fall back on repr(obj).
    �builtinsr.�...)	ry�typesr	�reprrx�
__module__�__qualname__�FunctionType�__name__��objs r�
_type_reprr��s����#�u�)�*�*���C�y�y���#�t���6��>�Z�'�'��#�#��.�5�5�3�#3�5�5�5�
�c�z�z��u��#�u�)�*�*���|����9�9�rc��g}|D]�}t|t��r�t|t��r2|D].}t|g��D]}||vr|�|����/�_t|d��r||vr|�|����t
|dd��D]}||vr|�|�����t|��S)aCollect all type variables and parameter specifications in args
    in order of first appearance (lexicographic order).

    For example::

        >>> P = ParamSpec('P')
        >>> T = TypeVar('T')
        >>> _collect_parameters((T, Callable[P, T]))
        (~T, ~P)
    �__typing_subst__�__parameters__r
)ryrxr��_collect_parameters�append�hasattr�getattr)r��
parameters�tr�	collecteds     rr�r��s���J�
�)�)���a����	)��
��5�
!�
!�
	)��
5�
5��!4�a�S�!9�!9�5�5�I� �
�2�2�"�)�)�)�4�4�4��5�
5��Q�*�
+�
+�	)��
�"�"��!�!�!�$�$�$���Q� 0�"�5�5�
)�
)���J�&�&��%�%�a�(�(�(��
)�����rc
��|st|�d����t|��}||kr#td||krdnd�d|�d|�d|�����dS)	z�Check correct count for parameters of a generic cls (internal helper).

    This gives a nice error message in case of count mismatch.
    � is not a generic class�Too �many�few� arguments for �	; actual �, expected N)r�r�)�clsr��elen�alens    r�_check_genericr�s���
�9��3�7�7�7�8�8�8��z�?�?�D��t�|�|��;�����v�v�%�;�;�PS�;�;�#'�;�;�48�;�;�<�<�	<��|rc��g}|D]L}t|dd��}|�"|r
|ddus|�|���7|�|���M|S)N�__typing_unpacked_tuple_args__���.)r��extendr�)r��newargsr{�subargss    r�_unpack_argsr�(sp���G�� � ���#�?��F�F������G�B�K�3�4F�4F��N�N�7�#�#�#�#��N�N�3������Nr��unhashable_fallbackc�|�	t�|��S#t$r|s�t|��cYSwxYwr)�dict�fromkeysr��_deduplicate_unhashable)�paramsr�s  r�_deduplicater�2sS��/��}�}�V�$�$�$���/�/�/�"�	��&�v�.�.�.�.�.�	/���s��;�;c�F�g}|D]}||vr|�|���|Sr)r�)�unhashable_params�new_unhashabler�s   rr�r�<s<���N�
�%�%���N�"�"��!�!�!�$�$�$���rc��t|��}t|��}t|��}	|D]}|�|���n#t$rYdSwxYw|S)NF)r�r��remove�
ValueError)�
first_args�second_args�first_unhashable�second_unhashabler��elems      r�_compare_args_orderlessr�Cs��.�z�:�:��/��<�<���
���A��$�	�	�D�
�H�H�T�N�N�N�N�	�������u�u������5�Ls�A
�

A�Ac���g}|D]S}t|ttjf��r|�|j���>|�|���Ttt|d�����S)zwInternal helper for Union creation and substitution.

    Flatten Unions among parameters, then remove duplicates.
    Tr�)	ry�_UnionGenericAliasr��	UnionTyper��__args__r�r�r��r�r��ps   r�_remove_dups_flattenr�Nsy���F�
�����a�,�e�o�>�?�?�	��M�M�!�*�%�%�%�%��M�M�!�������f�$�?�?�?�@�@�@rc��g}|D]G}t|t��r|�|j���2|�|���Ht|��S)zHInternal helper for Literal creation: flatten Literals among parameters.)ry�_LiteralGenericAliasr�r�r�r�r�s   r�_flatten_literal_paramsr�^sa��
�F�
�����a�-�.�.�	��M�M�!�*�%�%�%�%��M�M�!�������=�=�r��typedc�,���fd�}|�||��S|S)z�Internal wrapper caching __getitem__ of generic types.

    For non-hashable arguments, the original function is used as a fallback.
    c������tj��������t��j��tj�����fd���}|S)Nr�c�F��	�|i|��S#t$rYnwxYw�|i|��Sr�r�)r��kwds�cached�funcs  ��r�innerz+_tp_cache.<locals>.decorator.<locals>.innerusR���
��v�t�,�t�,�,�,���
�
�
���
�����4��&��&�&�&s��
�)�	functools�	lru_cache�	_cleanupsr��cache_clear�wraps)r�r�r�r�s` @�r�	decoratorz_tp_cache.<locals>.decoratorqss�����1��$�5�1�1�1�$�7�7������+�,�,�,�	���	�	�	'�	'�	'�	'�	'�
�	�	'��rr
)r�r�r�s ` r�	_tp_cacher�ls8���
��������y������rc�
����t|t��r|������St|ttt
jf���r+t|t��rotd�|jD����}|j	}t||��r|j|dd�|df}n
|j|}|r
t|}t���fd�|jD����}||jkr|St|t��rt	|j|��St|t
j��rtjtj|��S|�|��S|S)z�Evaluate all forward references in the given type t.

    For use of globalns and localns see the docstring for get_type_hints().
    recursive_guard is used to prevent infinite recursion with a recursive
    ForwardRef.
    c3�bK�|]*}t|t��rt|��n|V��+dSr)ryrzr��.0r{s  r�	<genexpr>z_eval_type.<locals>.<genexpr>�sO�������$.�c�3�#7�#7�@�
�3����S������rNr�c3�<�K�|]}t|�����V��dSr)�
_eval_type)r��a�globalns�localns�recursive_guards  ���rr�z_eval_type.<locals>.<genexpr>�s1�����^�^�a�
�1�h���I�I�^�^�^�^�^�^r)ryr�	_evaluater�r	r�r�r�r��__unpacked__r�r�rrr��reduce�operator�or_�	copy_with)r�r�r�r�r��is_unpacked�ev_argss ```   rr�r��s�������!�Z� � �?��{�{�8�W�o�>�>�>��!�m�\�5�?�C�D�D�(��a��&�&�	�����:������D��.�K�.�q�$�7�7�
'��L�$�s��s�)�T�"�X�!6�7����L��&���
��1�I���^�^�^�^�^�^�ST�S]�^�^�^�^�^���a�j� � ��H��a��&�&�	7����g�6�6�6��a���)�)�	(��#�H�L�'�:�:�:��;�;�w�'�'�'��Hrc��eZdZdZdZd�ZdS)�_FinalzMixin to prohibit subclassing.)�__weakref__c�,�d|vrtd���dS)N�_rootz&Cannot subclass special typing classesr�)r�r�r�s   r�__init_subclass__z_Final.__init_subclass__�s$���$����D�E�E�E��rN)r�r�r��__doc__�	__slots__rr
rrrr�s3������(�(� �I�F�F�F�F�Frrc�"�eZdZdZdZd�Zd�ZdS)�
_Immutablez3Mixin to indicate that object should not be copied.r
c��|Srr
��selfs r�__copy__z_Immutable.__copy__�����rc��|Srr
)r�memos  r�__deepcopy__z_Immutable.__deepcopy__�rrN)r�r�r�rrr
rr
rrr	r	�s=������=�=��I��������rr	c��eZdZdZdZdZdS)�_NotIterablea�Mixin to prevent iteration, without being compatible with Iterable.

    That is, we could do::

        def __iter__(self): raise TypeError()

    But this would make users of this mixin duck type-compatible with
    collections.abc.Iterable - isinstance(foo, Iterable) would be True.

    Luckily, we can instead prevent iteration by setting __iter__ to None, which
    is treated specially.
    r
N)r�r�r�rr�__iter__r
rrrr�s$���������I��H�H�Hrrc�d�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ed���Zd
S)r�)�_namer�_getitemc�D�||_|j|_|j|_dSr)rr�rr)r�getitems  r�__init__z_SpecialForm.__init__�s ����
��%��
������rc�6�|dvr|jSt|���)N>r�r�)r�AttributeError)r�items  r�__getattr__z_SpecialForm.__getattr__�s$���/�/�/��:���T�"�"�"rc�&�td|�����)N�Cannot subclass r�)r�basess  r�__mro_entries__z_SpecialForm.__mro_entries__�s���3�4�3�3�4�4�4rc��d|jzS�N�typing.�rrs r�__repr__z_SpecialForm.__repr__�����4�:�%�%rc��|jSrr&rs r�
__reduce__z_SpecialForm.__reduce__��
���z�rc�&�td|�����)NzCannot instantiate r�)rr�r�s   r�__call__z_SpecialForm.__call__�s���6�d�6�6�7�7�7rc� �t||fSr�r"�r�others  r�__or__z_SpecialForm.__or__�����T�5�[�!�!rc� �t||fSrr/r0s  r�__ror__z_SpecialForm.__ror__�����U�D�[�!�!rc�&�t|�d����)Nz! cannot be used with isinstance()r��rr�s  r�__instancecheck__z_SpecialForm.__instancecheck__�����4�B�B�B�C�C�Crc�&�t|�d����)Nz! cannot be used with issubclass()r��rr�s  r�__subclasscheck__z_SpecialForm.__subclasscheck__�r:rc�.�|�||��Sr)r�rr�s  r�__getitem__z_SpecialForm.__getitem__�s���}�}�T�:�.�.�.rN)r�r�r�rrrr"r'r*r-r2r5r9r=r�r@r
rrr�r��s�������0�I�'�'�'�
#�#�#�5�5�5�&�&�&����8�8�8�"�"�"�"�"�"�D�D�D�D�D�D��/�/��Y�/�/�/rr�)rc��eZdZd�ZdS)�_LiteralSpecialFormc�N�t|t��s|f}|j|g|�R�Sr)ryr�rr?s  rr@z_LiteralSpecialForm.__getitem__�s5���*�e�,�,�	'�$��J��t�}�T�/�J�/�/�/�/rN)r�r�r�r@r
rrrBrB�s#������0�0�0�0�0rrBc�(��eZdZ�fd�Z�fd�Z�xZS)�_AnyMetac�v��|turtd���t���|��S)Nz+typing.Any cannot be used with isinstance())rr��superr9)rr��	__class__s  �rr9z_AnyMeta.__instancecheck__s3����3�;�;��I�J�J�J��w�w�(�(��-�-�-rc�Z��|turdSt�����S)Nz
typing.Any)rrGr'�rrHs �rr'z_AnyMeta.__repr__s'����3�;�;��<��w�w���!�!�!r)r�r�r�r9r'�
__classcell__�rHs@rrErEsQ�������.�.�.�.�.�
"�"�"�"�"�"�"�"�"rrEc�"��eZdZdZ�fd�Z�xZS)raWSpecial type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    checks.
    c�v��|turtd���t���|��S)NzAny cannot be instantiated)rr�rG�__new__)r�r��kwargsrHs   �rrOzAny.__new__s1����#�:�:��8�9�9�9��w�w���s�#�#�#r)r�r�r�rrOrKrLs@rrrsB�������	�	�$�$�$�$�$�$�$�$�$rr)�	metaclassc�&�t|�d����)a�Special type indicating functions that never return.

    Example::

        from typing import NoReturn

        def stop() -> NoReturn:
            raise Exception('no way')

    NoReturn can also be used as a bottom type, a type that
    has no values. Starting in Python 3.11, the Never type should
    be used for this concept instead. Type checkers should treat the two
    equivalently.
    � is not subscriptabler�r?s  rreres�� �t�2�2�2�
3�
3�3rc�&�t|�d����)adThe bottom type, a type that has no members.

    This can be used to define a function that should never be
    called, or a function that never returns::

        from typing import Never

        def never_call_me(arg: Never) -> None:
            pass

        def int_or_str(arg: int | str) -> None:
            never_call_me(arg)  # type checker error
            match arg:
                case int():
                    print("It's an int")
                case str():
                    print("It's a str")
                case _:
                    never_call_me(arg)  # OK, arg is of type Never
    rSr�r?s  rrara3s��,�t�2�2�2�
3�
3�3rc�&�t|�d����)asUsed to spell the type of "self" in classes.

    Example::

        from typing import Self

        class Foo:
            def return_self(self) -> Self:
                ...
                return self

    This is especially useful for:
        - classmethods that are used as alternative constructors
        - annotating an `__enter__` method which returns self
    rSr�r?s  rrmrmLs��"�t�2�2�2�
3�
3�3rc�&�t|�d����)a
Represents an arbitrary literal string.

    Example::

        from typing import LiteralString

        def run_query(sql: LiteralString) -> None:
            ...

        def caller(arbitrary_string: str, literal_string: LiteralString) -> None:
            run_query("SELECT * FROM students")  # OK
            run_query(literal_string)  # OK
            run_query("SELECT * FROM " + literal_string)  # OK
            run_query(arbitrary_string)  # type checker error
            run_query(  # type checker error
                f"SELECT * FROM students WHERE name = {arbitrary_string}"
            )

    Only string literals and other LiteralStrings are compatible
    with LiteralString. This provides a tool to help prevent
    security issues such as SQL injection.
    rSr�r?s  rr`r``s��0�t�2�2�2�
3�
3�3rc�J�t||�d���}t||f��S)a>Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class.

    Usage::

        class Starship:
            stats: ClassVar[dict[str, int]] = {} # class variable
            damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    � accepts only single type.�r�r��rr�rs   rrr{�.��&�z�d�#F�#F�#F�G�G�D����w�'�'�'rc�J�t||�d���}t||f��S)a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.

    For example::

        MAX_SIZE: Final = 9000
        MAX_SIZE += 1  # Error reported by type checker

        class Connection:
            TIMEOUT: Final[int] = 10

        class FastConnector(Connection):
            TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    rXrYrZs   rrr�r[rc�x��|dkrtd���t|t��s|f}d�t�fd�|D����}t|��}t	|��dkr|dSt	|��dkr#td��|vrt
||d	�
��St
||��S)a�Union type; Union[X, Y] means either X or Y.

    On Python 3.10 and higher, the | operator
    can also be used to denote unions;
    X | Y means the same thing to the type checker as Union[X, Y].

    To define a union, use e.g. Union[int, str]. Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        assert Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        assert Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        assert Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        assert Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    r
z Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3�8�K�|]}t|���V��dSr�r��r�r�r�s  �rr�zUnion.<locals>.<genexpr>�s-�����?�?�q�{�1�c�*�*�?�?�?�?�?�?r�rr�Nr��name)r�ryr�r�r�rxr��rr�r�s  @rr"r"�s����>�R����:�;�;�;��j�%�(�(�#� �]�
�
5�C��?�?�?�?�J�?�?�?�?�?�J�%�j�1�1�J�
�:���!����!�}��
�:���!����T�
�
�j� 8� 8�!�$�
��D�D�D�D��d�J�/�/�/rc�`�t||�d���}t|td��fS)z,Optional[X] is equivalent to Union[X, None].z requires a single type.N)r�r"rx)rr�r{s   rrr�s1���j�T�"C�"C�"C�
D�
D�C���d�4�j�j��!�!rc
���t|��}	td�ttt	|������D����}n#t
$rYnwxYwt
||��S)aSpecial typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals)::

        def validate_simple(data: Any) -> Literal[True]:  # always returns True
            ...

        MODE = Literal['r', 'rb', 'w', 'wb']
        def open_helper(file: str, mode: MODE) -> str:
            ...

        open_helper('/some/path', 'r')  # Passes type check
        open_helper('/other/path', 'typo')  # Error in type checker

    Literal[...] cannot be subclassed. At runtime, an arbitrary value
    is allowed as type argument to Literal[...], but type checkers may
    impose restrictions.
    c3� K�|]	\}}|V��
dSrr
)r�r�rs   rr�zLiteral.<locals>.<genexpr>�s&����^�^���A�1�^�^�^�^�^�^r)r�r�r�r��_value_and_type_iterr�r�r?s  rrr�s���2)��4�4�J�
��^�^��d�;O�PZ�;[�;[�6\�6\�)]�)]�^�^�^�^�^�
�
���
�
�
���
���� ��j�1�1�1s�AA�
A�Ac�&�t|�d����)a:Special form for marking type aliases.

    Use TypeAlias to indicate that an assignment should
    be recognized as a proper type alias definition by type
    checkers.

    For example::

        Predicate: TypeAlias = Callable[..., bool]

    It's invalid when used anywhere except as in the example above.
    rSr�r?s  rrprp�s���t�2�2�2�
3�
3�3rc�0��|dkrtd���t|t��s|f}|ddus*t|dt��std���d�g�fd�|dd�D���|d�R}t	||d	�
��S)acSpecial form for annotating higher-order functions.

    ``Concatenate`` can be used in conjunction with ``ParamSpec`` and
    ``Callable`` to represent a higher-order function which adds, removes or
    transforms the parameters of a callable.

    For example::

        Callable[Concatenate[int, P], int]

    See PEP 612 for detailed information.
    r
z&Cannot take a Concatenate of no types.r�.zMThe last parameter to Concatenate should be a ParamSpec variable or ellipsis.z/Concatenate[arg, ...]: each arg must be a type.c3�8�K�|]}t|���V��dSrr_r`s  �rr�zConcatenate.<locals>.<genexpr>#s-�����A�A�A�K��3�'�'�A�A�A�A�A�ArNT��_paramspec_tvars)r�ryr�rr�rds  @rrr
s�����R����@�A�A�A��j�%�(�(�#� �]�
��r�N�c�!�!�Z�
�2��	�%J�%J�!��:�;�;�	;�
;�C�R�A�A�A�A��C�R�C��A�A�A�R�:�b�>�R�R�J�#�D�*�59�;�;�;�;rc�J�t||�d���}t||f��S)a�Special typing construct for marking user-defined type guard functions.

    ``TypeGuard`` can be used to annotate the return type of a user-defined
    type guard function.  ``TypeGuard`` only accepts a single type argument.
    At runtime, functions marked this way should return a boolean.

    ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
    type checkers to determine a more precise type of an expression within a
    program's code flow.  Usually type narrowing is done by analyzing
    conditional code flow and applying the narrowing to a block of code.  The
    conditional expression here is sometimes referred to as a "type guard".

    Sometimes it would be convenient to use a user-defined boolean function
    as a type guard.  Such a function should use ``TypeGuard[...]`` as its
    return type to alert static type checkers to this intention.

    Using  ``-> TypeGuard`` tells the static type checker that for a given
    function:

    1. The return value is a boolean.
    2. If the return value is ``True``, the type of its argument
       is the type inside ``TypeGuard``.

       For example::

           def is_str(val: Union[str, float]):
               # "isinstance" type guard
               if isinstance(val, str):
                   # Type of ``val`` is narrowed to ``str``
                   ...
               else:
                   # Else, type of ``val`` is narrowed to ``float``.
                   ...

    Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
    form of ``TypeA`` (it can even be a wider form) and this may lead to
    type-unsafe results.  The main reason is to allow for things like
    narrowing ``List[object]`` to ``List[str]`` even though the latter is not
    a subtype of the former, since ``List`` is invariant.  The responsibility of
    writing type-safe type guards is left to the user.

    ``TypeGuard`` also works with type variables.  For more information, see
    PEP 647 (User-Defined Type Guards).
    rXrYrZs   rrqrq(s/��\�z�d�#F�#F�#F�G�G�D����w�'�'�'rc�H�eZdZdZdZddd�d�Zd�Zd	�Zd
�Zd�Z	d�Z
d
�ZdS)rz-Internal wrapper to hold a forward reference.)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__�__forward_is_class__�__forward_module__TNF)rwc�X�t|t��std|�����|�d��rd|�d�}n|}	t	|dd��}n #t
$rtd|�����wxYw||_||_d|_d|_	||_
||_||_dS)	Nz*Forward reference must be a string -- got �*�(z,)[0]z<string>�evalz/Forward reference must be an expression -- got F)
ryrzr��
startswith�compile�SyntaxErrorrprqrrrsrtrurv)rr{r�rvrw�arg_to_compile�codes       rrzForwardRef.__init__bs����#�s�#�#�	R��P��P�P�Q�Q�Q�
�>�>�#���	!�+��^�^�^�N�N� �N�	Y��>�:�v�>�>�D�D���	Y�	Y�	Y��W�PS�W�W�X�X�X�	Y���� #��� $���%*��"�!%���'2��$�$,��!�"(����s�A�A6c��|j|vr|S|jr||ur�|�|�ix}}n	|�|}n|�|}|j�4ttj�|jd��d|��}tt|j	||��d|j
|j���}t|||||jhz��|_
d|_|j
S)N�__dict__z*Forward references must evaluate to types.)r�rtT)rprrrvr��sys�modules�getr�rzrqrtrur�rs)rr�r�r��type_s     rr�zForwardRef._evaluatezs�����?�2�2��K��)�	.�W�H�-D�-D���G�O�%'�'��7�7��!�"�����"���&�2�"��K�O�O�D�$;�T�B�B�J�PX���� ��T�*�H�g�>�>�<� �8�$(�$=�	���E�&0��x��/�T�=Q�<R�*R�&�&�D�"�*.�D�&��%�%rc���t|t��stS|jr'|jr |j|jko|j|jkS|j|jko|j|jkSr)ryr�NotImplementedrrrprsrvr0s  r�__eq__zForwardRef.__eq__�s����%��,�,�	"�!�!��%�	G�%�*E�	G��(�E�,A�A�F��*�e�.E�E�
G��$��(=�=�D��'�5�+C�C�	Erc�8�t|j|jf��Sr)�hashrprvrs r�__hash__zForwardRef.__hash__�s���T�)�4�+B�C�D�D�Drc� �t||fSrr/r0s  rr2zForwardRef.__or__�r3rc� �t||fSrr/r0s  rr5zForwardRef.__ror__�r6rc�D�|j�d}n
d|j��}d|j�|�d�S)N�z	, module=zForwardRef(�))rvrp)r�module_reprs  rr'zForwardRef.__repr__�s;���"�*��K�K�A�d�&=�A�A�K�C�T�1�C�[�C�C�C�Cr�TN)r�r�r�rrrr�r�r�r2r5r'r
rrrrZs�������7�7�'�I�
)�u�)�)�)�)�)�0&�&�&�4E�E�E�E�E�E�"�"�"�"�"�"�D�D�D�D�Drrr�returnc�P�t|t��ot|dd��S)N�#__typing_is_unpacked_typevartuple__F)ryrxr��rs r�_is_unpacked_typevartupler��s.���A�t�$�$�
$�
E��A�<�e�D�D�Frc�X�t|ttf��pt|��Sr)ryr rr�r�s r�_is_typevar_liker��s%���a�'�9�-�.�.�N�2K�A�2N�2N�Nrc��eZdZdZd�ZdS)�_PickleUsingNameMixinz/Mixin enabling pickling based on self.__name__.c��|jSr�r�rs rr*z _PickleUsingNameMixin.__reduce__��
���}�rN)r�r�r�rr*r
rrr�r��s)������9�9�����rr�c�*�eZdZdZd�Zd�Zd�Zd�ZdS)�_BoundVarianceMixina/Mixin giving __init__ bound and variance arguments.

    This is used by TypeVar and ParamSpec, which both employ the notions of
    a type 'bound' (restricting type arguments to be a subtype of some
    specified type) and type 'variance' (determining subtype relations between
    generic types).
    c��|r|rtd���t|��|_t|��|_|rt	|d��|_dSd|_dS)zfUsed to setup TypeVars and ParamSpec's bound, covariant and
        contravariant attributes.
        z"Bivariant types are not supported.zBound must be a type.N)r��bool�
__covariant__�__contravariant__r��	__bound__)r�bound�	covariant�
contravariants    rrz_BoundVarianceMixin.__init__�sk���	C��	C��A�B�B�B�!�)�_�_���!%�m�!4�!4����	"�(��0G�H�H�D�N�N�N�!�D�N�N�Nrc� �t||fSrr/�r�rights  rr2z_BoundVarianceMixin.__or__�r3rc� �t||fSrr/�r�lefts  rr5z_BoundVarianceMixin.__ror__�����T�4�Z� � rc�B�|jrd}n|jrd}nd}||jzS)N�+�-�~)r�r�r�)r�prefixs  rr'z_BoundVarianceMixin.__repr__�s8����	��F�F�
�
#�	��F�F��F���
�%�%rN)r�r�r�rrr2r5r'r
rrr�r��sZ��������"�"�"�"�"�"�!�!�!�&�&�&�&�&rr�c�2��eZdZdZdddd��fd�
Zd�Z�xZS)r a�Type variable.

    Usage::

      T = TypeVar('T')  # Can be anything
      A = TypeVar('A', str, bytes)  # Must be str or bytes

    Type variables exist primarily for the benefit of static type
    checkers.  They serve as the parameters for generic types as well
    as for generic function definitions.  See class Generic for more
    information on generic types.  Generic functions work as follows:

      def repeat(x: T, n: int) -> List[T]:
          '''Return a list containing n references to x.'''
          return [x]*n

      def longest(x: A, y: A) -> A:
          '''Return the longest of two strings.'''
          return x if len(x) >= len(y) else y

    The latter example's signature is essentially the overloading
    of (str, str) -> str and (bytes, bytes) -> bytes.  Also note
    that if the arguments are instances of some subclass of str,
    the return type is still plain str.

    At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.

    Type variables defined with covariant=True or contravariant=True
    can be used to declare covariant or contravariant generic types.
    See PEP 484 for more details. By default generic types are invariant
    in all type variables.

    Type variables can be introspected. e.g.:

      T.__name__ == 'T'
      T.__constraints__ == ()
      T.__covariant__ == False
      T.__contravariant__ = False
      A.__constraints__ == (str, bytes)

    Note that only type variables defined in global scope can be pickled.
    NF�r�r�r�c�J���||_t���|||��|r|�td���|r"t	|��dkrtd���d�t�fd�|D����|_t��}|dkr	||_dSdS)Nz-Constraints cannot be combined with bound=...raz"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3�8�K�|]}t|���V��dSrr_)r�r�r�s  �rr�z#TypeVar.__init__.<locals>.<genexpr>s-�����$N�$N�Q�[��C�%8�%8�$N�$N�$N�$N�$N�$Nr�typing)	r�rGrr�r�r��__constraints__�_callerr�)	rrcr�r�r��constraints�def_modr�rHs	       @�rrzTypeVar.__init__s�������
�
������	�=�9�9�9��	M�5�,��K�L�L�L��	B�3�{�+�+�q�0�0��@�A�A�A�J��$�$N�$N�$N�$N�+�$N�$N�$N�N�N����)�)���h���%�D�O�O�O��rc���d}t||d���}t|t��r|jtus&t|t
��r#t
|dd��rt|�d����|S)N�*Parameters to generic types must be types.T)r�r�Fr~)r�ryr�r�rrr	r�r�)rr{r�s   rr�zTypeVar.__typing_subst__s~��:���#�s��5�5�5��
��]�
+�
+�	D���&�0H�0H�
��\�
*�
*�1I�/6�s�N�E�/R�/R�1I��s�B�B�B�C�C�C��
r)r�r�r�rrr�rKrLs@rr r �sf�������)�)�V26� ��&�&�&�&�&�&�&�������rr c�0�eZdZdZd�Zd�Zd�Zd�Zd�ZdS)r!a~Type variable tuple.

    Usage:

      Ts = TypeVarTuple('Ts')  # Can be given any name

    Just as a TypeVar (type variable) is a placeholder for a single type,
    a TypeVarTuple is a placeholder for an *arbitrary* number of types. For
    example, if we define a generic class using a TypeVarTuple:

      class C(Generic[*Ts]): ...

    Then we can parameterize that class with an arbitrary number of type
    arguments:

      C[int]       # Fine
      C[int, str]  # Also fine
      C[()]        # Even this is fine

    For more details, see PEP 646.

    Note that only TypeVarTuples defined in global scope can be pickled.
    c�N�||_t��}|dkr	||_dSdS�Nr�)r�r�r�)rrcr�s   rrzTypeVarTuple.__init__@s2����
��)�)���h���%�D�O�O�O��rc#�(K�t|V�dSr�rrrs rrzTypeVarTuple.__iter__H������T�l�����rc��|jSrr�rs rr'zTypeVarTuple.__repr__Kr�rc� �td���)Nz2Substitution of bare TypeVarTuple is not supportedr��rr{s  rr�zTypeVarTuple.__typing_subst__Ns���L�M�M�Mrc	�"�|j}|�|��}||dzd�D])}t|t��rt	d|������*t|��}t|��}|}||z
dz
}	d}
d}t
|��D]e\}}
t|
t��sKt|
dd��}|r8t|��dkr%|ddur|
�t	d���|}
|d}�f|
�'t||
��}t|	||
z
dz
��}	n$||	z|krt	d	|�d
|�d|dz
�����g|d|��|g||z
z�t||||	z
����|g||	z
|z
|z
dz
z�|||	z
d��RS)Nraz(More than one TypeVarTuple parameter in r�r�r�.z6More than one unpacked arbitrary-length tuple argumentr�Too few arguments for r�z, expected at least )r��indexryr!r�r��	enumeraterxr��minr�)r�aliasr�r��typevartuple_index�paramr��plenr�r��var_tuple_index�fillarg�kr{r�s               r�__typing_prepare_subst__z%TypeVarTuple.__typing_prepare_subst__QsF���%��#�\�\�$�/�/���.��2�3�3�4�	T�	T�E��%��.�.�
T�� R�5� R� R�S�S�S�
T��4�y�y���6�{�{��!���)�)�A�-��������o�o�	)�	)�F�A�s��c�4�(�(�
)�!�#�'G��N�N���)�s�7�|�|�q�0�0�W�R�[�C�5G�5G�&�2�'�(`�a�a�a�&'�O�%�a�j�G���&��t�_�-�-�D���t�o�5��9�:�:�E�E�
�E�\�D�
 �
 ��J�U�J�J�'+�J�J�AE�a��J�J�K�K�
K�
�
�%�4�%�[�
��i�+�d�2�3�
�
�$�t�T�E�\�)�*�+�+�
��i�����,�/A�A�A�E�F�	
�
�$��,�-�-�
 �
�
�	
rN)	r�r�r�rrrr'r�r�r
rrr!r!'sl��������0&�&�&�������N�N�N�"
�"
�"
�"
�"
rr!c�$�eZdZdZd�Zd�Zd�ZdS)rha<The args for a ParamSpec object.

    Given a ParamSpec object P, P.args is an instance of ParamSpecArgs.

    ParamSpecArgs objects have a reference back to their ParamSpec:

       P.args.__origin__ is P

    This type is meant for runtime introspection and has no special meaning to
    static type checkers.
    c��||_dSr�r��r�origins  rrzParamSpecArgs.__init__��
�� ����rc� �|jj�d�S)Nz.args�r�r�rs rr'zParamSpecArgs.__repr__�s���/�*�1�1�1�1rc�Z�t|t��stS|j|jkSr)ryrhr�r�r0s  rr�zParamSpecArgs.__eq__�s*���%��/�/�	"�!�!���%�"2�2�2rN�r�r�r�rrr'r�r
rrrhrhvsK������
�
�!�!�!�2�2�2�3�3�3�3�3rrhc�$�eZdZdZd�Zd�Zd�ZdS)riaFThe kwargs for a ParamSpec object.

    Given a ParamSpec object P, P.kwargs is an instance of ParamSpecKwargs.

    ParamSpecKwargs objects have a reference back to their ParamSpec:

       P.kwargs.__origin__ is P

    This type is meant for runtime introspection and has no special meaning to
    static type checkers.
    c��||_dSrr�r�s  rrzParamSpecKwargs.__init__�r�rc� �|jj�d�S)Nz.kwargsr�rs rr'zParamSpecKwargs.__repr__�s���/�*�3�3�3�3rc�Z�t|t��stS|j|jkSr)ryrir�r�r0s  rr�zParamSpecKwargs.__eq__�s*���%��1�1�	"�!�!���%�"2�2�2rNr�r
rrriri�sK������
�
�!�!�!�4�4�4�3�3�3�3�3rric�d��eZdZdZed���Zed���Zdddd��fd�
Zd�Zd	�Z	�xZ
S)
ra�Parameter specification variable.

    Usage::

       P = ParamSpec('P')

    Parameter specification variables exist primarily for the benefit of static
    type checkers.  They are used to forward the parameter types of one
    callable to another callable, a pattern commonly found in higher order
    functions and decorators.  They are only valid when used in ``Concatenate``,
    or as the first argument to ``Callable``, or as parameters for user-defined
    Generics.  See class Generic for more information on generic types.  An
    example for annotating a decorator::

       T = TypeVar('T')
       P = ParamSpec('P')

       def add_logging(f: Callable[P, T]) -> Callable[P, T]:
           '''A type-safe decorator to add logging to a function.'''
           def inner(*args: P.args, **kwargs: P.kwargs) -> T:
               logging.info(f'{f.__name__} was called')
               return f(*args, **kwargs)
           return inner

       @add_logging
       def add_two(x: float, y: float) -> float:
           '''Add two numbers together.'''
           return x + y

    Parameter specification variables can be introspected. e.g.:

       P.__name__ == 'P'

    Note that only parameter specification variables defined in global scope can
    be pickled.
    c� �t|��Sr)rhrs rr�zParamSpec.args�s���T�"�"�"rc� �t|��Sr)rirs rrPzParamSpec.kwargs�s���t�$�$�$rNFr�c���||_t���|||��t��}|dkr	||_dSdSr�)r�rGrr�r�)rrcr�r�r�r�rHs      �rrzParamSpec.__init__�sM�����
�
������	�=�9�9�9��)�)���h���%�D�O�O�O��rc��t|ttf��rtd�|D����}n!t|��st	d|�����|S)Nc3�6K�|]}t|d��V��dS)zExpected a type.Nr_�r�r�s  rr�z-ParamSpec.__typing_subst__.<locals>.<genexpr>�s-����H�H�q��A�'9�:�:�H�H�H�H�H�HrzFExpected a list of types, an ellipsis, ParamSpec, or Concatenate. Got )ryr�r�r�r�r�s  rr�zParamSpec.__typing_subst__�sw���c�D�%�=�)�)�	E��H�H�C�H�H�H�H�H�C�C���$�$�	E��D�>A�D�D�E�E�
E��
rc��|j}|�|��}|t|��krtd|�����t|��dkr!t	|d��s|dksJ�|f}nJt||t��r/g|d|��t||���||dzd��R}|S)Nr�rar)r�r�r�r�r�ryr�r�)rr�r�r��is     rr�z"ParamSpec.__typing_prepare_subst__�s����%���L�L�������D�	�	�>�>��<�U�<�<�=�=�=��v�;�;�!���N�4��7�$;�$;����6�6�6�6��7�D�D�
��Q���
&�
&�	<�;�T�"�1�"�X�;�u�T�!�W�~�~�;��Q�q�S�T�T�
�;�;�D��r)r�r�r�r�propertyr�rPrr�r�rKrLs@rrr�s��������#�#�J�#�#��X�#��%�%��X�%�'+�e�5�&�&�&�&�&�&�&����������rrc�V�|�d��o|�d��S)N�__)r{�endswith)�attrs r�
_is_dunderr��s%���?�?�4� � �8�T�]�]�4�%8�%8�8rc�X��eZdZdZddd�d�Zd�Zd�Zd�Z�fd	�Zd
�Z	d�Z
�fd�Z�xZS)
�_BaseGenericAliasa�The central part of the internal API.

    This represents a generic version of type 'origin' with type arguments 'params'.
    There are two kind of these aliases: user defined and special. The special ones
    are wrappers around builtin collections and ABCs in collections.abc. These must
    have 'name' always set. If 'inst' is False, then the alias can't be instantiated;
    this is used by e.g. typing.List and typing.Dict.
    TN��instrcc�>�||_||_||_d|_dSr)�_instrr�r)rr�r�rcs    rrz_BaseGenericAlias.__init__�s"����
���
� �������rc��|js%td|j�d|jj�d����|j|i|��}	||_n#t$rYnwxYw|S)NzType z cannot be instantiated; use z
() instead)r�r�rr�r��__orig_class__�	Exception)rr�rP�results    rr-z_BaseGenericAlias.__call__s����z�	I��H�D�J�H�H�#'�?�#;�H�H�H�I�I�
I� ���$�1�&�1�1��	�$(�F�!�!���	�	�	��D�	�����
s�A�
A�Ac�@�g}|j|vr|�|j��|�|��}||dzd�D].}t|t��st|t��rn�/|�t��t|��S�Nra)r�r�r�ryr��
issubclassrr�)rr!�resr��bs     rr"z!_BaseGenericAlias.__mro_entries__s������?�%�'�'��J�J�t��'�'�'��K�K������q��s�t�t��	 �	 �A��!�.�/�/�
�:�a��3I�3I�
���
�
�J�J�w�����S�z�z�rc��|dvr|jp|jjSd|jvr$t	|��st|j|��St
|���)N>r�r�r�)rr�r�r�r�r�r)rr�s  rrz_BaseGenericAlias.__getattr__s\���/�/�/��:�9���!9�9��4�=�(�(��D�1A�1A�(��4�?�D�1�1�1��T�"�"�"rc���t|��s|dvr$t���||��dSt|j||��dS)N>r�r�_nparamsrm)r�rG�__setattr__�setattrr�)rr��valrHs   �rrz_BaseGenericAlias.__setattr__(s^����d���	0�t�(<� <� <��G�G����c�*�*�*�*�*��D�O�T�3�/�/�/�/�/rc�F�|�t|����Sr�r=rxr8s  rr9z#_BaseGenericAlias.__instancecheck__/����%�%�d�3�i�i�0�0�0rc� �td���)NzBSubscripted generics cannot be used with class and instance checksr�r<s  rr=z#_BaseGenericAlias.__subclasscheck__2s���5�6�6�	6rc	���ttt�����d�t	|j��D��z����S)Nc�0�g|]}t|���|��Sr
)r�)r�r�s  r�
<listcomp>z-_BaseGenericAlias.__dir__.<locals>.<listcomp>8s%��Q�Q�Q�D�
�4�@P�@P�Q�4�Q�Q�Qr)r��setrG�__dir__�dirr�rJs �rrz_BaseGenericAlias.__dir__6sW����C������)�)�Q�Q�C���$8�$8�Q�Q�Q�R�S�S�T�T�	Tr)
r�r�r�rrr-r"rrr9r=rrKrLs@rr�r��s����������(,�$���������
�
�
�#�#�#�0�0�0�0�0�1�1�1�6�6�6�T�T�T�T�T�T�T�T�Trr�c���eZdZdddd��fd�
Zd�Zd�Zd�Zd	�Zed
���Z	d�Z
d�Zd
�Zd�Z
d�Z�fd�Zd�Z�xZS)r�TNF)r�rcrmc���t���|||���t|t��s|f}td�|D����|_t|��|_||_|s|j|_dSdS)Nr�c3�0K�|]}|turdn|V��dS).N)�_TypingEllipsisr�s  rr�z)_GenericAlias.__init__.<locals>.<genexpr>esE����/�/�$%�&'�/�%9�%9�c�c��/�/�/�/�/�/r)	rGrryr�r�r�r�rmr�)rr�r�r�rcrmrHs      �rrz_GenericAlias.__init__`s����
������d���6�6�6��$��&�&�	��7�D��/�/�)-�/�/�/�/�/��
�1�$�7�7��� 0����	0�$�/�D�O�O�O�	0�	0rc�z�t|t��stS|j|jko|j|jkSr)ryr�r�r�r�r0s  rr�z_GenericAlias.__eq__ls=���%��/�/�	"�!�!���5�#3�3�4��M�U�^�3�	5rc�8�t|j|jf��Sr)r�r�r�rs rr�z_GenericAlias.__hash__rs���T�_�d�m�4�5�5�5rc� �t||fSrr/r�s  rr2z_GenericAlias.__or__ur3rc� �t||fSrr/r�s  rr5z_GenericAlias.__ror__xr�rc�Z�|jttfvrtd|�����|jst|�d����t|t��s|f}t
d�|D����}t|��}|�|��}|�	|��}|S)Nz%Cannot subscript already-subscripted r�c3�4K�|]}t|��V��dSr�r|�r�r�s  rr�z,_GenericAlias.__getitem__.<locals>.<genexpr>�s*����4�4�!�]�1�%�%�4�4�4�4�4�4r)
r�rrr�r�ryr�r��_determine_new_argsr�)rr��new_args�rs    rr@z_GenericAlias.__getitem__{s���"�?�w��1�1�1��J�D�J�J�K�K�K��"�	>��t�<�<�<�=�=�=��$��&�&�	��7�D��4�4�t�4�4�4�4�4���D�!�!���+�+�D�1�1���N�N�8�$�$���rc
�p�|j}|D]!}t|dd��}|�|||��}�"t|��}t|��}||kr#td||krdnd�d|�d|�d|�����t	t||����}t
|�|j|����S)Nr�r�r�r�r�r�r�)	r�r�r�r�r��zipr��_make_substitutionr�)rr�r�r��preparer�r��new_arg_by_params        rrz!_GenericAlias._determine_new_args�s����$���	+�	+�E��e�%?��F�F�G��"��w�t�T�*�*����4�y�y���6�{�{���4�<�<��?�T�D�[�[�6�6�e�?�?�TX�?�?�'+�?�?�8<�?�?�@�@�
@���F�D� 1� 1�2�2���T�,�,�T�]�<L�M�M�N�N�Nrc	�P�g}|D�]�}t|t��r|�|���.t|dd��}|r|||��}n~t|dd��}|s|}nhg}|D]N}	t|	t��r|�||	���3|�||	���O|t
|��}|jtj	j
kr,t|t��r|�|����t|��r|�|����=t|t��r8|�t
|�||���������|�|�����|S)z$Create a list of new type arguments.r�Nr�r
)
ryrxr�r�r!r�r�r�r�r�rr�r#)
rr�r%r�old_arg�	substfunc�new_arg�	subparamsr�rs
          rr#z _GenericAlias._make_substitution�s������8	)�8	)�G��'�4�(�(�
�����(�(�(����);�T�B�B�I��

6�#�)�$4�W�$=�>�>���#�G�-=�r�B�B�	� �	6�%�G�G� �G�&�@�@��%�a��6�6�@�#�N�N�+;�A�+>�?�?�?�?�#�N�N�+;�A�+>�?�?�?�?�%�e�G�n�n�5�G���+�/�":�:�:�z�'�SX�?Y�?Y�:�����(�(�(�(�*�7�3�3�
)�����(�(�(�(��G�U�+�+�
)�����$�1�1�'�;K�L�L�M�M���������(�(�(�(��rc�^�|�|j||j|j|j���S)N�rcr�rm)rHr�rr�rm�rr�s  rr�z_GenericAlias.copy_with�s4���~�~�d�o�t�$�*�4�:�/3�/D��F�F�	Frc��|jrd|jz}nt|j��}|jr%d�d�|jD����}nd}|�d|�d�S)Nr%�, c�,�g|]}t|����Sr
�r�r�s  rrz*_GenericAlias.__repr__.<locals>.<listcomp>s��C�C�C��j��m�m�C�C�Crz()�[�])rr�r�r��join)rrcr�s   rr'z_GenericAlias.__repr__�su���:�	/��t�z�)�D�D��d�o�.�.�D��=�	��9�9�C�C�T�]�C�C�C�D�D�D�D��D�� � �� � � � rc��|jrt��|j}n|j}t|j��}t|��dkrt
|dt��s|\}tj||ffS�Nrar)	r�globalsr�r�r�r�ryr�r)rr�r�s   rr*z_GenericAlias.__reduce__sn���:�	%��Y�Y�t�z�*�F�F��_�F��T�]�#�#���t�9�9��>�>�*�T�!�W�e�"<�"<�>��E�D���&�$��/�/rc�p��t|jt��rtd|�����|jr!t���|��S|jturLt|vrdS|�	|��}||dzd�D]}t|t��r||urdS�|jfS)Nr r
ra)ryr�r�r�rrGr"rrr�r�)rr!r�rrHs    �rr"z_GenericAlias.__mro_entries__s�����d�o�|�4�4�	9��7�t�7�7�8�8�8��:�	2��7�7�*�*�5�1�1�1��?�g�%�%��5� � ��r����D�!�!�A��1�Q�3�4�4�[�
�
���a�!2�3�3����
�
��2�2����!�!rc#�(K�t|V�dSrr�rs rrz_GenericAlias.__iter__r�r)r�r�r�rr�r�r2r5r�r@rr#r�r'r*r"rrKrLs@rr�r�Fs�������4.2��"'�
0�
0�
0�
0�
0�
0�
0�5�5�5�6�6�6�"�"�"�!�!�!�����Y��>O�O�O�:<�<�<�|F�F�F�
!�
!�
!�0�0�0�
"�
"�
"�
"�
"�������rr�c�d��eZdZddd��fd�
Zed���Zd�Zd�Z�fd�Zd	�Z	d
�Z
d�Z�xZS)�_SpecialGenericAliasTNr�c����|�|j}t���|||���||_|jdkrd|j�d�|_dSd|j�d|j�d�|_dS)Nr�r�zA generic version of r)r�rGrrr�r�r)rr��nparamsr�rcrHs     �rrz_SpecialGenericAlias.__init__(s�����<��?�D�
������d���6�6�6���
���
�*�*�I�6�3F�I�I�I�D�L�L�L�]�6�3D�]�]�v�GZ�]�]�]�D�L�L�Lrc����t|t��s|f}d�t�fd�|D����}t|||j��|�|��S)Nr�c3�8�K�|]}t|���V��dSrr_r`s  �rr�z3_SpecialGenericAlias.__getitem__.<locals>.<genexpr>7�-�����;�;�q�{�1�c�*�*�;�;�;�;�;�;r)ryr�r�rr��rr�r�s  @rr@z _SpecialGenericAlias.__getitem__2si����&�%�(�(�	��Y�F�:���;�;�;�;�F�;�;�;�;�;���t�V�T�]�3�3�3��~�~�f�%�%�%rc�F�t|j||j|j���S)N)rcr�)r�r�rr��rr�s  rr�z_SpecialGenericAlias.copy_with;s(���T�_�f�"&�*�4�:�?�?�?�	?rc��d|jzSr$r&rs rr'z_SpecialGenericAlias.__repr__?r(rc���t|t��rt|j|j��St|t��st||j��St���|��Sr)ryr;r�r�r�rGr=)rr�rHs  �rr=z&_SpecialGenericAlias.__subclasscheck__Bsf����c�/�0�0�	?��c�n�d�o�>�>�>��#�}�-�-�	4��c�4�?�3�3�3��w�w�(�(��-�-�-rc��|jSrr&rs rr*z_SpecialGenericAlias.__reduce__Ir+rc� �t||fSrr/r�s  rr2z_SpecialGenericAlias.__or__Lr3rc� �t||fSrr/r�s  rr5z_SpecialGenericAlias.__ror__Or�r)
r�r�r�rr�r@r�r'r=r*r2r5rKrLs@rr;r;'s��������04�4�^�^�^�^�^�^�^��&�&��Y�&�?�?�?�&�&�&�.�.�.�.�.����"�"�"�!�!�!�!�!�!�!rr;c�$��eZdZ�fd�Zd�Z�xZS)�_CallableGenericAliasc�>��|jdksJ�|j}t|��dkr5t|d��r t	�����Sdd�d�|dd�D�����dt|d���d	�S)
Nrr�rztyping.Callable[[r/c�,�g|]}t|����Sr
r1r�s  rrz2_CallableGenericAlias.__repr__.<locals>.<listcomp>Ys��A�A�A�!�
�1�
�
�A�A�Arr�z], r3)rr�r�r�rGr'r4r��rr�rHs  �rr'z_CallableGenericAlias.__repr__Ss�����z�Z�'�'�'�'��}���t�9�9��>�>�n�T�!�W�5�5�>��7�7�#�#�%�%�%�+��Y�Y�A�A�t�C�R�C�y�A�A�A�B�B�+�+��d�2�h�'�'�+�+�+�	,rc���|j}t|��dkrt|d��st|dd���|df}tjt|ffS)Nr�rr�)r�r�r�r�r�rrr-s  rr*z _CallableGenericAlias.__reduce__\sW���}���D�	�	�Q���>�$�q�'�#:�#:����S�b�S�	�?�?�D��H�,�D���(�D�!1�1�1r)r�r�r�r'r*rKrLs@rrJrJRsG�������,�,�,�,�,�2�2�2�2�2�2�2rrJc�0�eZdZd�Zd�Zed���ZdS)�
_CallableTypec�H�t|j||j|jd���S)NTr,)rJr�rr�rCs  rr�z_CallableType.copy_withds+��$�T�_�f�*.�*�4�:�6:�<�<�<�	<rc��t|t��rt|��dkrtd���|\}}t|t��rt|��|f}n||f}|�|��S)Nr�z6Callable must be used as Callable[[arg, ...], result].)ryr�r�r�r��__getitem_inner__)rr�r�r�s    rr@z_CallableType.__getitem__is����&�%�(�(�	=�C��K�K�1�,<�,<��<�=�=�
=����f��d�D�!�!�	$��D�k�k�6�*�F�F��F�^�F��%�%�f�-�-�-rc��|\}}d}t||��}|tur|�t|f��St	|t
��s|f}td�|D����}||fz}|�|��S)Nz.Callable[args, result]: result must be a type.c3�4K�|]}t|��V��dSrrr�s  rr�z2_CallableType.__getitem_inner__.<locals>.<genexpr>�s*����8�8�C�]�3�'�'�8�8�8�8�8�8r)r��Ellipsisr�rryr�)rr�r�r�r�s     rrSz_CallableType.__getitem_inner__ws������f�>���V�S�)�)���8����>�>�?�F�";�<�<�<��$��&�&�	��7�D��8�8�4�8�8�8�8�8����	�!���~�~�f�%�%�%rN)r�r�r�r�r@r�rSr
rrrPrPcsM������<�<�<�
.�.�.��
&�
&��Y�
&�
&�
&rrPc�$�eZdZed���ZdS)�
_TupleTypec�Z��t|t��s|f}t|��dkrN|ddurDd�t�fd�|dd�D����}|�g|�t�R��Sd�t�fd�|D����}|�|��S)Nr�r�.z Tuple[t, ...]: t must be a type.c3�8�K�|]}t|���V��dSrr_r`s  �rr�z)_TupleType.__getitem__.<locals>.<genexpr>�s-�����D�D�1�;�q�#�.�.�D�D�D�D�D�Drz*Tuple[t0, t1, ...]: each t must be a type.c3�8�K�|]}t|���V��dSrr_r`s  �rr�z)_TupleType.__getitem__.<locals>.<genexpr>�r@r)ryr�r�r�rrAs  @rr@z_TupleType.__getitem__�s�����&�%�(�(�	��Y�F��v�;�;�!����r�
�c� 1� 1�4�C��D�D�D�D��s��s��D�D�D�D�D�F��>�>�"<�F�"<�O�"<�"<�=�=�=�:���;�;�;�;�F�;�;�;�;�;���~�~�f�%�%�%rN)r�r�r�r�r@r
rrrXrX�s-�������	&�	&��Y�	&�	&�	&rrXc�F��eZdZd�Zd�Zd�Z�fd�Zd�Zd�Z�fd�Z	�xZ
S)r�c��t|Srr/rCs  rr�z_UnionGenericAlias.copy_with�s���V�}�rc��t|ttjf��stS	t|j��t|j��kS#t$rt|j|j��cYSwxYwr)	ryr�r�r�r�rr�r�r�r0s  rr�z_UnionGenericAlias.__eq__�s����%�"4�e�o�!F�G�G�	"�!�!�	J��t�}�%�%��U�^�)<�)<�<�<���	J�	J�	J�*�4�=�%�.�I�I�I�I�I�	J���s�)A�$A;�:A;c�D�tt|j����Sr)r��	frozensetr�rs rr�z_UnionGenericAlias.__hash__�s���I�d�m�,�,�-�-�-rc�8��|j}t|��dkr`|dtd��urdt|d���d�S|dtd��urdt|d���d�St	�����S)Nr�rztyping.Optional[rar3)r�r�rxr�rGr'rMs  �rr'z_UnionGenericAlias.__repr__�s�����}���t�9�9��>�>��A�w�$�t�*�*�$�$�@�*�T�!�W�*=�*=�@�@�@�@��a��D��J�J�&�&�@�*�T�!�W�*=�*=�@�@�@�@��w�w���!�!�!rc�F�|�t|����Srr	r8s  rr9z$_UnionGenericAlias.__instancecheck__�r
rc�@�|jD]}t||��rdS�dS)NT)r�r�)rr�r{s   rr=z$_UnionGenericAlias.__subclasscheck__�s;���=�	�	�C��#�s�#�#�
��t�t�
�	�	rc�f��t�����\}\}}|t|ffSr)rGr*r")rr�r�r�rHs    �rr*z_UnionGenericAlias.__reduce__�s0���$�w�w�1�1�3�3���n�v�t��e�T�]�"�"r)r�r�r�r�r�r�r'r9r=r*rKrLs@rr�r��s�����������J�J�J�.�.�.�"�"�"�"�"�1�1�1����
#�#�#�#�#�#�#�#�#rr�c��d�|D��S)Nc3�8K�|]}|t|��fV��dSr)rxrs  rr�z'_value_and_type_iter.<locals>.<genexpr>�s,����-�-�Q�Q��Q���L�-�-�-�-�-�-rr
)r�s rrhrh�s��-�-�*�-�-�-�-rc��eZdZd�Zd�ZdS)r�c���t|t��stStt	|j����tt	|j����kSr)ryr�r�rrhr�r0s  rr�z_LiteralGenericAlias.__eq__�sN���%�!5�6�6�	"�!�!��'��
�6�6�7�7�3�?S�TY�Tb�?c�?c�;d�;d�d�drc�^�ttt|j������Sr)r�r`rhr�rs rr�z_LiteralGenericAlias.__hash__�s#���I�2�4�=�A�A�B�B�C�C�CrN)r�r�r�r�r�r
rrr�r��s:������e�e�e�D�D�D�D�Drr�c���eZdZ�fd�Z�xZS)r�c���t|dttf��rg|dd��|d�RSt|dt��rg|dd��|dj�R}t���|��S)Nr�)ryr�r�r�r�rGr�)rr�rHs  �rr�z"_ConcatenateGenericAlias.copy_with�s�����f�R�j�4��-�0�0�	/�.�V�C�R�C�[�.�6�"�:�.�.�.��f�R�j�":�;�;�	:�9�v�c�r�c�{�9�V�B�Z�%8�9�9�F��w�w� � ��(�(�(r)r�r�r�r�rKrLs@rr�r��s8�������)�)�)�)�)�)�)�)�)rr�c�L�t||�d���}t||f���S)a�Type unpack operator.

    The type unpack operator takes the child types from some container type,
    such as `tuple[int, str]` or a `TypeVarTuple`, and 'pulls them out'.

    For example::

        # For some generic class `Foo`:
        Foo[Unpack[tuple[int, str]]]  # Equivalent to Foo[int, str]

        Ts = TypeVarTuple('Ts')
        # Specifies that `Bar` is generic in an arbitrary number of types.
        # (Think of `Ts` as a tuple of an arbitrary number of individual
        #  `TypeVar`s, which the `Unpack` is 'pulling out' directly into the
        #  `Generic[]`.)
        class Bar(Generic[Unpack[Ts]]): ...
        Bar[int]  # Valid
        Bar[int, str]  # Also valid

    From Python 3.11, this can also be done using the `*` operator::

        Foo[*tuple[int, str]]
        class Bar(Generic[*Ts]): ...

    Note that there is only some runtime checking of this operator. Not
    everything the runtime allows may be accepted by static type checkers.

    For more information, see PEP 646.
    rX)r�r�)r��_UnpackGenericAliasrZs   rrrrr�s1��>�z�d�#F�#F�#F�G�G�D��d�$��9�9�9�9rc�P��eZdZd�Z�fd�Zed���Zed���Z�xZS)rmc�<�dt|jd��zS)Nrxr)r�r�rs rr'z_UnpackGenericAlias.__repr__�s���T�$�-��*�+�+�+�+rc�X��|jr|St���|��Sr)r�rGr@rMs  �rr@z_UnpackGenericAlias.__getitem__�s+����3�	��K��w�w�"�"�4�(�(�(rc���|jtusJ�t|j��dksJ�|j\}t	|t
��r|jtusJ�|jSdSr�)r�rrr�r�ryr�r�r�s  rr�z2_UnpackGenericAlias.__typing_unpacked_tuple_args__�sk����&�(�(�(�(��4�=�!�!�Q�&�&�&�&��}����c�=�)�)�	 ��>�U�*�*�*�*��<���trc��|jtusJ�t|j��dksJ�t	|jdt
��Sr6)r�rrr�r�ryr!rs rr�z7_UnpackGenericAlias.__typing_is_unpacked_typevartuple__sG����&�(�(�(�(��4�=�!�!�Q�&�&�&�&��$�-��*�L�9�9�9r)	r�r�r�r'r@r�r�r�rKrLs@rrmrm�s}�������,�,�,�
)�)�)�)�)�
����X���:�:��X�:�:�:�:�:rrmc�@��eZdZdZdZdZed���Z�fd�Z�xZ	S)raCAbstract base class for generic types.

    A generic type is typically declared by inheriting from
    this class parameterized with one or more type variables.
    For example, a generic mapping type might be defined as::

      class Mapping(Generic[KT, VT]):
          def __getitem__(self, key: KT) -> VT:
              ...
          # Etc.

    This class can then be used as follows::

      def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
          try:
              return mapping[key]
          except KeyError:
              return default
    r
Fc�:�t|t��s|f}td�|D����}|ttfvr�|st	d|j�d����t
d�|D����st	d|j�d����tt|����t|��krt	d|j�d����n�|j
D]!}t|dd	��}|�|||��}�"t||t|j
����g}t|j
|��D]E\}}t|t��r|�|���0|�|���Ft|��}t#||d
���S)a�Parameterizes a generic class.

        At least, parameterizing a generic class is the *main* thing this method
        does. For example, for some generic class `Foo`, this is called when we
        do `Foo[int]` - there, with `cls=Foo` and `params=int`.

        However, note that this method is also called when defining generic
        classes in the first place with `class Foo(Generic[T]): ...`.
        c3�4K�|]}t|��V��dSrrrs  rr�z,Generic.__class_getitem__.<locals>.<genexpr>4s*����8�8�A�}�Q�'�'�8�8�8�8�8�8rzParameter list to z[...] cannot be emptyc3�4K�|]}t|��V��dSr)r�rs  rr�z,Generic.__class_getitem__.<locals>.<genexpr>;s+����;�;�q�'��*�*�;�;�;�;�;�;rzParameters to zF[...] must all be type variables or parameter specification variables.z[...] must all be uniquer�NTrl)ryr�rrr�r��allr�r�rr�r�r�r"r!r�r�r�)r�r�r�r$rr)s      r�__class_getitem__zGeneric.__class_getitem__&s����&�%�(�(�	��Y�F��8�8��8�8�8�8�8���7�H�%�%�%��
��P��)9�P�P�P�����;�;�F�;�;�;�;�;�
>��=�S�\�=�=�=�>�>�>��3�v�;�;���3�v�;�;�.�.��K�S�\�K�K�K�M�M�M�/�
�+�
2�
2��!�%�)C�T�J�J���&�$�W�S�&�1�1�F���3���C�,>�(?�(?�@�@�@��H�"%�c�&8�&�"A�"A�
-�
-���w��e�\�2�2�-��O�O�G�,�,�,�,��O�O�G�,�,�,�,��8�_�_�F��S�&�.2�4�4�4�	4rc����
�t��j|i|��g}d|jvrt|jv}n1t|jvo"|jdkot|��tk}|rtd���d|jvr�t|j��}d}|jD]=}t|t��r&|j
tur|�td���|j}�>|�|t|��}t|���
|�
ksVd��
fd�|D����}d�d�|D����}	td|�d	|	�d
����|}t#|��|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple times.r/c3�>�K�|]}|�v�t|��V��dSr�rz)r�r��gvarsets  �rr�z,Generic.__init_subclass__.<locals>.<genexpr>ss3�����&Q�&Q�!���@P�@P�s�1�v�v�@P�@P�@P�@P�&Q�&Qrc3�4K�|]}t|��V��dSrr|)r��gs  rr�z,Generic.__init_subclass__.<locals>.<genexpr>ts(����&=�&=�!�s�1�v�v�&=�&=�&=�&=�&=�&=rzSome type variables (z) are not listed in Generic[r3)rGrr�rrz�	__bases__r�rx�_TypedDictMetar�r�ryr�r�r�rr4r�)r�r�rP�tvars�error�gvars�base�tvarset�s_vars�s_argsr}rHs          @�rrzGeneric.__init_subclass__Us�����!����!�4�2�6�2�2�2����s�|�+�+��s�1�1�E�E���
�-�4���
�2�4��S�	�	�^�3�
��	A��?�@�@�@��s�|�+�+�'��(:�;�;�E��E��*�
0�
0���t�]�3�3�0���7�2�2��(�'�N�P�P�P� �/�E��� ��e�*�*���e�*�*���'�)�)�!�Y�Y�&Q�&Q�&Q�&Q�u�&Q�&Q�&Q�Q�Q�F�!�Y�Y�&=�&=�u�&=�&=�&=�=�=�F�#�%H�F�%H�%H�>D�%H�%H�%H�I�I�I���"�5�\�\����r)
r�r�r�rr�_is_protocolr�rxrrKrLs@rrrsh���������&�I��L��,4�,4��Y�,4�\#*�#*�#*�#*�#*�#*�#*�#*�#*rrc��eZdZdZdS)rz(Internal placeholder for ... (ellipsis).N)r�r�r�rr
rrrr{s������2�2�2�2rr)r�rzr�r��_is_runtime_protocol�	__final__)�__abstractmethods__�__annotations__r�rrr�rOr�__subclasshook__rrx�_MutableMapping__markerc�x�t��}|jdd�D]�}|jdvr�t|di��}t	|j�����t	|�����zD]5}|�d��s|tvr|�	|���6��|S)z�Collect protocol members from a protocol class objects.

    This includes names actually defined in the class dictionary, as well
    as names that appear in annotations. Special names (above) are skipped.
    Nr�)rrr��_abc_)
r�__mro__r�r�r�r��keysr{�EXCLUDED_ATTRIBUTES�add)r��attrsr��annotationsr�s     r�_get_protocol_attrsr��s���
�E�E�E���C�R�C� � � ���=�3�3�3���d�$5�r�:�:�����+�+�-�-�.�.��k�6F�6F�6H�6H�1I�1I�I�	 �	 �D��?�?�7�+�+�
 ��<O�0O�0O��	�	�$�����	 ��Lrc�T��t�fd�t���D����S)Nc3�T�K�|]"}tt�|d����V��#dSr)�callabler�)r�r�r�s  �rr�z,_is_callable_members_only.<locals>.<genexpr>�s7�����W�W�d�x���T�4�0�0�1�1�W�W�W�W�W�Wr)rwr��r�s`r�_is_callable_members_onlyr��s0����W�W�W�W�>Q�RU�>V�>V�W�W�W�W�W�Wrc�,�t|��}|jrtd���|jturdS|jD]4}|j�dt��}|tur	||_n�5tj|_|j|g|�Ri|��dS)Nz Protocols cannot be instantiatedr)	rxr�r�r�_no_init_or_replace_initr�r�r��object)rr�rPr�r��inits      rr�r��s���
�t�*�*�C�
��<��:�;�;�;��|�3�3�3�����'�'���}� � ��-E�F�F���/�/�/��C�L��E�0�
�����C�L��'��'�'�'��'�'�'�'�'rra�__main__c��	tj|dz��j�d|��S#tt
f$rYdSwxYw)Nrar�)r��	_getframe�	f_globalsr�rr�)�depth�defaults  rr�r��sU����}�U�Q�Y�'�'�1�5�5�j�'�J�J�J���J�'�����t�t����s�/2�A�A�c�$�t|��dvS)z�Allow instance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    >Nr�r�)r��r�s r�_allow_reckless_class_checksr��s���5�>�>�7�7�7r)
rr4r)r*r6r'r2r%r8r;�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibc���eZdZ�fd�Z�xZS)�
_ProtocolMetac�����t�dd��r0t�dd��std���std���t�dd��rt���rt	�j���rdS�jr+t��fd�t���D����rdSt���
���S)	Nr�Fr�r�r��LInstance and class checks can only be used with @runtime_checkable protocolsTc3��K�|]E}t�|��o0tt�|d����pt�|��duV��FdSr)r�r�r�)r�r�r��instances  ��rr�z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>�sy�����:�:��	�8�T�*�*�:�!�'�#�t�T�":�":�;�;�;�9��X�t�,�,�D�8�:�:�:�:�:�:r)r�r�r�r�r�rHr�rwr�rGr9)r�r�rHs``�rr9z_ProtocolMeta.__instancecheck__�s�����
�C���/�/�	=���3�U�;�;�	=�-�1�5�5�5�	=�
�<�=�=�
=���n�e�4�4�	�)�#�.�.�	��8�-�s�3�3�	��4���	��:�:�:�:�:�!4�C� 8� 8�	:�:�:�:�:�
�
�t��w�w�(�(��2�2�2r)r�r�r�r9rKrLs@rr�r��s8�������3�3�3�3�3�3�3�3�3rr�c�.��eZdZdZdZdZdZ�fd�Z�xZS)ra_Base class for protocol classes.

    Protocol classes are defined as::

        class Proto(Protocol):
            def meth(self) -> int:
                ...

    Such classes are primarily used with static type checkers that recognize
    structural subtyping (static duck-typing).

    For example::

        class C:
            def meth(self) -> int:
                return 0

        def func(x: Proto) -> int:
            return x.meth()

        func(C())  # Passes static type check

    See PEP 544 for details. Protocol classes decorated with
    @typing.runtime_checkable act as simple-minded runtime protocols that check
    only the presence of given attributes, ignoring their type signatures.
    Protocol classes can be generic, they are defined as::

        class GenProto(Protocol[T]):
            def meth(self) -> T:
                ...
    r
TFc����t��j|i|���j�dd��s#t	d��jD�����_�fd�}d�jvr|�_�jsdS�jD]g}|ttfvsU|j
tvr|jt|j
vs.t|t��r|jstd|z����h�jt jurt"�_dSdS)Nr�Fc3�(K�|]
}|tuV��dSr)r�r�rs  rr�z-Protocol.__init_subclass__.<locals>.<genexpr>s&����"H�"H�Q�1��=�"H�"H�"H�"H�"H�"Hrc����j�dd��stSt�dd��s$t	��rtStd���t
���s$t	��rtStd���t|t��std���t���D]�}|j
D]w}||jvr|j|�tccSn\t|di��}t|tjj
��r"||vrt|t��r	|jrn
�xtcS��dS)	Nr�Fr�r�z<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr�T)r�r�r�r�r�r�r�ryrxr�r�r�r�r,r�rr�)r1r�r�r�r�s    �r�_proto_hookz/Protocol.__init_subclass__.<locals>._proto_hooks�����<�#�#�N�E�:�:�
&�%�%��3� 6��>�>�
A�/�1�1�*�)�)��!@�A�A�A�,�S�1�1�
?�/�1�1�*�)�)��!>�?�?�?��e�T�*�*�
F�� D�E�E�E�,�C�0�0�
*�
*��!�M�*�*�D��t�}�,�,��=��.�6�#1�1�1�1�1�1���#*�$�0A�2�"F�"F�K�"�;���0G�H�H�� �K�/�/�&�u�g�6�6�0�;@�;M�0����)�)�)�)���4rr�z7Protocols can only inherit from other protocols, got %r)rGrr�r��anyr�r�r�r�rr��_PROTO_ALLOWLISTr�r�r�rrr�)r�r�rPr�r�rHs`    �rrzProtocol.__init_subclass__sI����!����!�4�2�6�2�2�2��|�����6�6�	I�"�"H�"H�#�-�"H�"H�"H�H�H�C��$	�$	�$	�$	�$	�L�S�\�1�1�#.�C� ���	��F��M�	=�	=�D��V�W�-�-�-��O�'7�7�7��M�%5�d�o�%F�F�F��t�W�-�-�G�26�2C�G��!5�7;�!<�=�=�=���<�8�,�,�,�3�C�L�L�L�-�,r)	r�r�r�rrr�r�rrKrLs@rrr�sU���������@�I��L� ��>4�>4�>4�>4�>4�>4�>4�>4�>4rrc�J��eZdZdZ�fd�Zd�Zd�Zd�Zd�Zd�Z	�fd�Z
�xZS)	�_AnnotatedAliasa�Runtime representation of an annotated type.

    At its core 'Annotated[t, dec1, dec2, ...]' is an alias for the type 't'
    with extra annotations. The alias behaves like a normal typing alias.
    Instantiating is the same as instantiating the underlying type; binding
    it to types is also the same.

    The metadata itself is stored in a '__metadata__' attribute as a tuple.
    c���t|t��r|j|z}|j}t	���||��||_dSr)ryr��__metadata__r�rGr)rr��metadatarHs   �rrz_AnnotatedAlias.__init__csR����f�o�.�.�	'��*�X�5�H��&�F�
�������(�(�(�$����rc�f�t|��dksJ�|d}t||j��Sr6)r�r�r�)rr��new_types   rr�z_AnnotatedAlias.copy_withjs5���6�{�{�a������!�9���x��):�;�;�;rc��d�t|j��d�d�|jD������S)Nztyping.Annotated[{}, {}]r/c3�4K�|]}t|��V��dSr)r�r�s  rr�z+_AnnotatedAlias.__repr__.<locals>.<genexpr>rs(����9�9�!�d�1�g�g�9�9�9�9�9�9r)�formatr�r�r4r�rs rr'z_AnnotatedAlias.__repr__osH��)�0�0��t��'�'��I�I�9�9�t�'8�9�9�9�9�9�
�
�	
rc�H�tjt|jf|jzffSr)r�rrr�r�rs rr*z_AnnotatedAlias.__reduce__us)�������)�D�,=�=�"
�
�	
rc�z�t|t��stS|j|jko|j|jkSr)ryr�r�r�r�r0s  rr�z_AnnotatedAlias.__eq__zs?���%��1�1�	"�!�!���5�#3�3�<��%��);�;�	=rc�8�t|j|jf��Sr)r�r�r�rs rr�z_AnnotatedAlias.__hash__�s���T�_�d�&7�8�9�9�9rc�R��|dvrdSt���|��S)N>r�r�r)rGr)rr�rHs  �rrz_AnnotatedAlias.__getattr__�s,����/�/�/��;��w�w�"�"�4�(�(�(r)r�r�r�rrr�r'r*r�r�rrKrLs@rr�r�Xs����������%�%�%�%�%�<�<�<�

�
�
�
�
�
�
=�=�=�:�:�:�)�)�)�)�)�)�)�)�)rr�c�R�eZdZdZdZd�Zd�Zed���d���Zd�Z	d	S)
ra�Add context-specific metadata to a type.

    Example: Annotated[int, runtime_check.Unsigned] indicates to the
    hypothetical runtime_check module that this type is an unsigned int.
    Every other consumer of this type can ignore this metadata and treat
    this type as int.

    The first argument to Annotated must be a valid type.

    Details:

    - It's an error to call `Annotated` with less than two arguments.
    - Access the metadata via the ``__metadata__`` attribute::

        assert Annotated[int, '$'].__metadata__ == ('$',)

    - Nested Annotated types are flattened::

        assert Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]

    - Instantiating an annotated type is equivalent to instantiating the
    underlying type::

        assert Annotated[C, Ann1](5) == C(5)

    - Annotated can be used as a generic type alias::

        Optimized: TypeAlias = Annotated[T, runtime.Optimize()]
        assert Optimized[int] == Annotated[int, runtime.Optimize()]

        OptimizedList: TypeAlias = Annotated[list[T], runtime.Optimize()]
        assert OptimizedList[int] == Annotated[list[int], runtime.Optimize()]

    - Annotated cannot be used with an unpacked TypeVarTuple::

        Variadic: TypeAlias = Annotated[*Ts, Ann1]  # NOT valid

      This would be equivalent to::

        Annotated[T1, T2, T3, ..., Ann1]

      where T1, T2 etc. are TypeVars, which would be invalid, because
      only one type should be passed to Annotated.
    r
c� �td���)Nz&Type Annotated cannot be instantiated.r��r�r�rPs   rrOzAnnotated.__new__�s���@�A�A�Arc�N�t|t��s|f}|j|g|�R�Sr)ryr��_class_getitem_inner)r�r�s  rrxzAnnotated.__class_getitem__�s6���&�%�(�(�	��Y�F�'�s�'��5�f�5�5�5�5rTr�c��t|��dkrtd���t|d��rtd���d}t|d|d���}t	|dd���}t||��S)	Nr�zUAnnotated[...] should be used with at least two arguments (a type and an annotation).rz?Annotated[...] should not be used with an unpacked TypeVarTuplez$Annotated[t, ...]: t must be a type.Trsra)r�r�r�r�r�r�)r�r�r�r�r�s     rr�zAnnotated._class_getitem_inner�s����v�;�;��?�?��+�,�,�
,�%�V�A�Y�/�/�	5��4�5�5�
5�4���V�A�Y���F�F�F��������$�$���v�x�0�0�0rc�P�td�|j�����)NzCannot subclass {}.Annotated)r�r�r�r�s   rrzAnnotated.__init_subclass__�s'���*�1�1�#�.�A�A�
�
�	
rN)
r�r�r�rrrOrxr�r�rr
rrrr�s������+�+�Z�I�B�B�B�6�6�6�
�Y�T����1�1���1�
�
�
�
�
rrc�p�t|t��r|jstd|z���d|_|S)a:Mark a protocol class as a runtime protocol.

    Such protocol can be used with isinstance() and issubclass().
    Raise TypeError if applied to a non-protocol class.
    This allows a simple-minded structural check very similar to
    one trick ponies in collections.abc such as Iterable.

    For example::

        @runtime_checkable
        class Closable(Protocol):
            def close(self): ...

        assert isinstance(open('/some/file'), Closable)

    Warning: this will check only the presence of the required methods,
    not their type signatures!
    zB@runtime_checkable can be only applied to protocol classes, got %rT)r�rr�r�r�r�s rrlrl�sL��&�c�7�#�#�)�3�+;�)��"�$'�(�)�)�	)�#�C���Jrc��|S)z�Cast a value to a type.

    This returns the value unchanged.  To the type checker this
    signals that the return value has the designated type, but at
    runtime we intentionally don't check anything (we want this
    to be as fast as possible).
    r
)r�rs  rrWrW�s	���Jrc��|S)a�Ask a static type checker to confirm that the value is of the given type.

    At runtime this does nothing: it returns the first argument unchanged with no
    checks or side effects, no matter the actual type of the argument.

    When a static type checker encounters a call to assert_type(), it
    emits an error if the value is not of the specified type::

        def greet(name: str) -> None:
            assert_type(name, str)  # OK
            assert_type(name, int)  # type checker error
    r
)rr�s  rrUrU�s	���Jrc��t|dd��riSt|t���r=i}t|j��D�]}|�5tt
j�|jd��di��}n|}|j	�di��}t|tj��ri}|�tt|����n|}|�|�||}}|���D]S\}	}
|
�td��}
t|
t��rt!|
dd���}
t#|
||��}
|
||	<�T��|r|nd�|���D��S|�at|tj��r|j	}n:|}t'|d	��r|j}t'|d	���t|d
i��}|�|}n|�|}t|dd��}|�9t|t*��riSt-d�|�����t|��}|���D]j\}	}
|
�td��}
t|
t��r+t!|
t|tj��d���}
t#|
||��||	<�k|r|nd�|���D��S)
a
Return type hints for an object.

    This is often the same as obj.__annotations__, but it handles
    forward references encoded as string literals and recursively replaces all
    'Annotated[T, ...]' with 'T' (unless 'include_extras=True').

    The argument may be a module, class, method, or function. The annotations
    are returned as a dictionary. For classes, annotations include also
    inherited members.

    TypeError is raised if the argument is not of a type that can contain
    annotations, and an empty dictionary is returned if no annotations are
    present.

    BEWARE -- the behavior of globalns and localns is counterintuitive
    (unless you are familiar with how eval() and exec() work).  The
    search order is locals first, then globals.

    - If no dict arguments are passed, an attempt is made to use the
      globals from obj (or the respective module's globals for classes),
      and these are also used as the locals.  If the object does not appear
      to have globals, an empty dictionary is used.  For classes, the search
      order is globals first then locals.

    - If one dict argument is passed, it is used for both globals and
      locals.

    - If two dict arguments are passed, they specify globals and
      locals, respectively.
    �__no_type_check__Nr�r�FT)r�rwc�4�i|]\}}|t|����Sr
��_strip_annotations�r�r�r�s   r�
<dictcomp>z"get_type_hints.<locals>.<dictcomp>K	s'��,`�,`�,`�$�!�Q�Q�0B�1�0E�0E�,`�,`�,`r�__wrapped__�__globals__z1{!r} is not a module, class, method, or function.c�4�i|]\}}|t|����Sr
r�r�s   rr�z"get_type_hints.<locals>.<dictcomp>o	s'��(\�(\�(\�d�a���,>�q�,A�,A�(\�(\�(\r)r�ryrx�reversedr�r�r�r�r�r�r��GetSetDescriptorTyper��vars�itemsrzrr��
ModuleTyper�r��_allowed_typesr�r�)r�r�r��include_extras�hintsr��base_globals�ann�base_localsrc�value�nsobjs            rr^r^	s��>�s�'��.�.���	��#�t���a����S�[�)�)�	$�	$�D���&�s�{���t���'M�'M�z�[]�^�^���'���-�#�#�$5�r�:�:�C��#�u�9�:�:�
���.5�o�$�t�D�z�z�*�*�*�7�K���8�#3�-8��k��"�y�y�{�{�
$�
$���e��=� ��J�J�E��e�S�)�)�P�&�u�%�$�O�O�O�E�"�5�,��D�D��#��d���

$�'�`�u�u�,`�,`�RW�R]�R]�R_�R_�,`�,`�,`�`����c�5�+�,�,�	9��|�H�H��E��%��/�/�
*��)���%��/�/�
*��u�m�R�8�8�H��?��G��	�����C�*�D�1�1�E��}��c�>�*�*�	8��I��+�+1�6�#�;�;�8�8�
8���K�K�E��{�{�}�}�;�;���e��=���J�J�E��e�S�!�!�	��� *�3��0@� A� A�A�����E�
!���'�:�:��d���"�\�5�5�(\�(\�e�k�k�m�m�(\�(\�(\�\rc���t|t��rt|j��St	|d��r/|jt
tfvrt|jd��St|t��r@td�|jD����}||jkr|S|�
|��St|t��r@td�|jD����}||jkr|St|j|��St|tj
��rJtd�|jD����}||jkr|Stjt j|��S|S)z(Strip the annotations from a given type.r�rc3�4K�|]}t|��V��dSrr�r�s  rr�z%_strip_annotations.<locals>.<genexpr>y	�+����H�H��0��3�3�H�H�H�H�H�Hrc3�4K�|]}t|��V��dSrr�r�s  rr�z%_strip_annotations.<locals>.<genexpr>~	r�rc3�4K�|]}t|��V��dSrr�r�s  rr�z%_strip_annotations.<locals>.<genexpr>�	r�r)ryr�r�r�r�rjrfr�r�r�r�r	r�r�r�r�r�r�)r��
stripped_argss  rr�r�r	sa���!�_�%�%�0�!�!�,�/�/�/��q�,���1�A�L�X�{�4K�$K�$K�!�!�*�Q�-�0�0�0��!�]�#�#�*��H�H�Q�Z�H�H�H�H�H�
��A�J�&�&��H��{�{�=�)�)�)��!�\�"�"�9��H�H�Q�Z�H�H�H�H�H�
��A�J�&�&��H��A�L�-�8�8�8��!�U�_�%�%�=��H�H�Q�Z�H�H�H�H�H�
��A�J�&�&��H�����m�<�<�<��Hrc��t|t��rtSt|ttt
tf��r|jS|turtSt|tj
��rtj
SdS)a�Get the unsubscripted version of a type.

    This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar,
    Annotated, and others. Return None for unsupported types.

    Examples::

        >>> P = ParamSpec('P')
        >>> assert get_origin(Literal[42]) is Literal
        >>> assert get_origin(int) is None
        >>> assert get_origin(ClassVar[int]) is ClassVar
        >>> assert get_origin(Generic) is Generic
        >>> assert get_origin(Generic[T]) is Generic
        >>> assert get_origin(Union[T, int]) is Union
        >>> assert get_origin(List[Tuple[T, T]][int]) is list
        >>> assert get_origin(P.args) is P
    N)ryr�rr�r	rhrir�rr�r���tps rr\r\�	sv��$�"�o�&�&�����"�(�,�$�o�7�8�8���}��	�W�}�}����"�e�o�&�&������4rc�:�t|t��r|jf|jzSt|tt
f��r8|j}t||��rt|dd���|df}|St|tj
��r|jSdS)a�Get type arguments with all substitutions performed.

    For unions, basic simplifications used by Union constructor are performed.

    Examples::

        >>> T = TypeVar('T')
        >>> assert get_args(Dict[str, int]) == (str, int)
        >>> assert get_args(int) == ()
        >>> assert get_args(Union[int, Union[T, int], str][int]) == (int, str)
        >>> assert get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
        >>> assert get_args(Callable[[], T][int]) == ([], int)
    Nr�r
)ryr�r�r�r�r	r�r�r�r�r�)r�rs  rr[r[�	s����"�o�&�&�2��
��"�/�1�1��"�}�l�3�4�4���k��*�2�s�3�3�	,���C�R�C��>�>�3�r�7�+�C��
��"�e�o�&�&���{��
�2rc�,�t|t��S)a+Check if an annotation is a TypedDict class.

    For example::

        >>> from typing import TypedDict
        >>> class Film(TypedDict):
        ...     title: str
        ...     year: int
        ...
        >>> is_typeddict(Film)
        True
        >>> is_typeddict(dict)
        False
    )ryr�r�s rr_r_�	s���b�.�)�)�)r�dr{c��t|��}t|��tkr|dt�dz}td|�����)a�Statically assert that a line of code is unreachable.

    Example::

        def int_or_str(arg: int | str) -> None:
            match arg:
                case int():
                    print("It's an int")
                case str():
                    print("It's a str")
                case _:
                    assert_never(arg)

    If a type checker finds that a call to assert_never() is
    reachable, it will emit an error.

    At runtime, this throws an exception when called.
    Nr�z*Expected code to be unreachable, but got: )r�r��_ASSERT_NEVER_REPR_MAX_LENGTH�AssertionError)r{r�s  rrVrV�	sN��&
��I�I�E�
�5�z�z�1�1�1��4�4�4�5��=��
�M�e�M�M�
N�
N�Nrc��t|t��r�t|��D]�}t||��}t	|d��r4|j|j�d|j��kst|dd��|jkr�Wt|tj	��rd|_
t|tj��rd|j_
t|t��rt|����	d|_
n#t$rYnwxYw|S)aIDecorator to indicate that annotations are not type hints.

    The argument must be a class or function; if it is a class, it
    applies recursively to all methods and classes defined in that class
    (but not to methods defined in its superclasses or subclasses).

    This mutates the function(s) or class(es) in place.
    r�rr�NT)ryrxrr�r�r�r�r�r�r�r��
MethodType�__func__rcr�)r{�keyr�s   rrcrc�	s���#�t���#��s�8�8�	#�	#�C��#�s�#�#�C��C��0�0�
��#�#�*:�'K�'K�S�\�'K�'K�K�K��3��d�3�3�s�~�E�E�
��#�u�1�2�2�
-�(,��%��#�u�/�0�0�
6�15���.��#�t�$�$�
#��c�"�"�"��
� $������
�
�
���
�����Js�)C1�1
C>�=C>c�F��tj����fd���}|S)z�Decorator to give another decorator the @no_type_check effect.

    This wraps the decorator with something that wraps the decorated
    function in @no_type_check.
    c�6���|i|��}t|��}|Sr)rc)r�r�r�r�s   �r�wrapped_decoratorz2no_type_check_decorator.<locals>.wrapped_decorator
s)����y�$�'�$�'�'���T�"�"���r)r�r�)r�rs` rrdrd
s;����_�Y������� ���
�rc� �td���)z*Helper for @overload to raise when called.z�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.)�NotImplementedError)r�r�s  r�_overload_dummyr$
s��
�	9�:�:�:rc��t|d|��}	|t|j|j|jj<n#t$rYnwxYwtS)a�Decorator for overloaded functions/methods.

    In a stub file, place two or more stub definitions for the same
    function in a row, each decorated with @overload.

    For example::

        @overload
        def utf8(value: None) -> None: ...
        @overload
        def utf8(value: bytes) -> bytes: ...
        @overload
        def utf8(value: str) -> bytes: ...

    In a non-stub file (i.e. a regular .py file), do the same but
    follow it with an implementation.  The implementation should *not*
    be decorated with @overload::

        @overload
        def utf8(value: None) -> None: ...
        @overload
        def utf8(value: bytes) -> bytes: ...
        @overload
        def utf8(value: str) -> bytes: ...
        def utf8(value):
            ...  # implementation goes here

    The overloads for a function can be retrieved at runtime using the
    get_overloads() function.
    r�)r��_overload_registryr�r��__code__�co_firstlinenorr)r��fs  rrgrg1
sd��@	��j�$�'�'�A�
�VZ��1�<�(���8���9R�S�S���
�
�
���
�����s�*>�
A�
Ac���t|d|��}|jtvrgSt|j}|j|vrgSt	||j�����S)z6Return all defined overloads for *func* as a sequence.r�)r�r�rr�r��values)r�r
�mod_dicts   rr]r]Z
sg��	��j�$�'�'�A��|�-�-�-��	�!�!�,�/�H��~�X�%�%��	�����(�/�/�1�1�2�2�2rc�8�t���dS)z$Clear all overloads in the registry.N)r�clearr
rrrXrXf
s���������rc�F�	d|_n#ttf$rYnwxYw|S)a�Decorator to indicate final methods and final classes.

    Use this decorator to indicate to type checkers that the decorated
    method cannot be overridden, and decorated class cannot be subclassed.

    For example::

        class Base:
            @final
            def done(self) -> None:
                ...
        class Sub(Base):
            def done(self) -> None:  # Error reported by type checker
                ...

        @final
        class Leaf:
            ...
        class Other(Leaf):  # Error reported by type checker
            ...

    There is no runtime checking of these properties. The decorator
    attempts to set the ``__final__`` attribute to ``True`` on the decorated
    object to allow runtime introspection.
    T)r�rr�)r
s rrZrZk
s>��4
�������I�&�
�
�
�	
��	
����

�Hs�
���T�KT�VT�T_co)r��V_co�VT_co�T_contra)r��CT_co)r�r�rTr�aDeprecated alias to collections.abc.Callable.

    Callable[[int], str] signifies a function that takes a single
    parameter of type int and returns a str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.
    The argument list must be a list of types, a ParamSpec,
    Concatenate or ellipsis. The return type must be a single type.

    There is no syntax to indicate optional or keyword arguments;
    such function types are rarely used as callback types.
    r#rbr�rr�a]Deprecated alias to builtins.tuple.

    Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    rHrErJrKr&r:rFrGraDeprecated alias to builtins.type.

    builtins.type or typing.Type can be used to annotate class objects.
    For example, suppose we have the following classes::

        class User: ...  # Abstract base for User classes
        class BasicUser(User): ...
        class ProUser(User): ...
        class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

        U = TypeVar('U', bound=User)
        def new_user(user_class: Type[U]) -> U:
            user = user_class()
            # (Here we could write the user object to a database)
            return user

        joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c�2�eZdZdZdZedefd���ZdS)rAz(An ABC with one abstract method __int__.r
r�c��dSrr
rs r�__int__zSupportsInt.__int__����rN)r�r�r�rrr�intrr
rrrArA�
sD������2�2��I��
��
�
�
��^�
�
�
rrAc�2�eZdZdZdZedefd���ZdS)r?z*An ABC with one abstract method __float__.r
r�c��dSrr
rs r�	__float__zSupportsFloat.__float__rrN)r�r�r�rrr�floatr r
rrr?r?	�D������4�4��I��
�5�
�
�
��^�
�
�
rr?c�2�eZdZdZdZedefd���ZdS)r>z,An ABC with one abstract method __complex__.r
r�c��dSrr
rs r�__complex__zSupportsComplex.__complex__rrN)r�r�r�rrr�complexr%r
rrr>r>sD������6�6��I��
�W�
�
�
��^�
�
�
rr>c�2�eZdZdZdZedefd���ZdS)r=z*An ABC with one abstract method __bytes__.r
r�c��dSrr
rs r�	__bytes__zSupportsBytes.__bytes__%rrN)r�r�r�rrr�bytesr)r
rrr=r=r"rr=c�2�eZdZdZdZedefd���ZdS)r@z*An ABC with one abstract method __index__.r
r�c��dSrr
rs r�	__index__zSupportsIndex.__index__0rrN)r�r�r�rrrrr-r
rrr@r@*sD������4�4��I��
�3�
�
�
��^�
�
�
rr@c�2�eZdZdZdZedefd���ZdS)r<zMAn ABC with one abstract method __abs__ that is covariant in its return type.r
r�c��dSrr
rs r�__abs__zSupportsAbs.__abs__;rrN)r�r�r�rrrrr0r
rrr<r<5sD������W�W��I��
��
�
�
��^�
�
�
rr<c�8�eZdZdZdZeddedefd���ZdS)	rBzOAn ABC with one abstract method __round__ that is covariant in its return type.r
r�ndigitsr�c��dSrr
)rr2s  r�	__round__zSupportsRound.__round__FrrN�r)	r�r�r�rrrrrr4r
rrrBrB@sP������Y�Y��I��
�
��
�T�
�
�
��^�
�
�
rrBr
c��d�|D��}d�|D��}tj||||���}|x|_|j_|S)Nc��g|]\}}|��Sr
r
�r��nr�s   rrz!_make_nmtuple.<locals>.<listcomp>Ls��
"�
"�
"�D�A�q�a�
"�
"�
"rc	�>�i|]\}}|t|d|�d�����S)zfield z annotation must be a typer_r8s   rr�z!_make_nmtuple.<locals>.<dictcomp>MsD��
 �
 �
 ���A���A�E��E�E�E�F�F�
 �
 �
 r��defaultsrv)r��
namedtupler�rO)rcr�rvr<�fields�nm_tpls      r�
_make_nmtupler@Ksm��
"�
"�E�
"�
"�
"�F�
 �
 ��
 �
 �
 �E�
�
#�D�&�-5�f�F�F�F�F�>C�C�F��V�^�;��Mr>
�_makerO�_asdict�_fields�_sourcer�_replacer�__getnewargs__�_field_defaults>r�r�r�c��eZdZd�ZdS)�NamedTupleMetac�(��t|vsJ�|D]#}|tur|turtd����$td�|D����}��di��}g}|D]^}|�vr|�|���|r@td|�dt
|��dkrdnd�d	d
�|��������_t||j	���fd�|D���d�
��}||_
t|vr%tjj}	t|	��|_�D]F}
|
tvrtd|
z���|
t vr |
|jvrt%||
�|
���Gt|vr|���|S)Nz3can only inherit from a NamedTuple type and Genericc3�:K�|]}|turtn|V��dSr)�_NamedTupler�)r�r�s  rr�z)NamedTupleMeta.__new__.<locals>.<genexpr>ds0����O�O��t�{�2�2�e�e��O�O�O�O�O�Orr�zNon-default namedtuple field z cannot follow default fieldra�sr�� r/c� ��g|]
}�|��Sr
r
)r�r9�nss  �rrz*NamedTupleMeta.__new__.<locals>.<listcomp>ps���(F�(F�(F�1��A��(F�(F�(Frr�r;z&Cannot overwrite NamedTuple attribute )rLrr�r�r�r�r�r4r@r�r�rxr��classmethod�_prohibitedr�_specialrCrr)r��typenamer!rPr�r��
default_names�
field_namer?�
class_getitemr�s   `       rrOzNamedTupleMeta.__new__^s����e�#�#�#�#��	K�	K�D��;�&�&�4�w�+>�+>��I�K�K�K���O�O��O�O�O�O�O�����(�"�-�-���
��	?�	?�J��R����$�$�Z�0�0�0�0��
?��!>�
�!>�!>�*-�m�*<�*<�q�*@�*@�3�3�b�!>�!>�$(�9�9�]�#;�#;�!>�!>�?�?�?�
?�
�x������(F�(F�(F�(F�
�(F�(F�(F�&(��&6�8�8�8��!����e���#�5�>�M�'2�=�'A�'A�F�$��	.�	.�C��k�!�!�$�%M�PS�%S�T�T�T��H�$�$��F�N�)B�)B����R��W�-�-�-���e����$�$�&�&�&��
rN)r�r�r�rOr
rrrIrI]s#������ � � � � rrIc��|�|���}n|rtd���t||t�����S)a?Typed version of namedtuple.

    Usage::

        class Employee(NamedTuple):
            name: str
            id: int

    This is equivalent to::

        Employee = collections.namedtuple('Employee', ['name', 'id'])

    The resulting class has an extra __annotations__ attribute, giving a
    dict that maps field names to types.  (The field names are also in
    the _fields attribute, which is part of the namedtuple API.)
    An alternative equivalent functional syntax is also accepted::

        Employee = NamedTuple('Employee', [('name', str), ('id', int)])
    NzIEither list of fields or keywords can be provided to NamedTuple, not both�rv)r�r�r@r�)rTr>rPs   rrLrL�sU��(�~��������	�D��C�D�D�	D���6�'�)�)�<�<�<�<rrLc�(�t|vsJ�tfSr)rLrL�r!s r�_namedtuple_mro_entriesr\�s���������>�rc�$�eZdZdd�ZeZd�ZeZdS)r�Tc����|D]0}t|��tur|turtd����1t	d�|D����r	tf}nd}t�t|g|�t�R|���i}|�di��}d���fd�|���D��}t��}	t��}
|D]�}|�
|j�di����|j�dt����}|	|z}	|
|z}
|j�dt����}|	|z}	|
|z}
��|�
|��|���D]�\}
}t|��}|tur(t|��}|r|d	}t|��}|turd
}n|t urd}n|}|r+|	�|
��|
�|
����|
�|
��|	�|
����|	�|
��sJd|�d
|	�d|
�����|�_t+|	���_t+|
���_t1�d��s|�_�S)a7Create a new typed dict class object.

        This method is called when TypedDict is subclassed,
        or when TypedDict is instantiated. This way
        TypedDict supports all three syntax forms described in its docstring.
        Subclasses and instances of TypedDict return actual dictionaries.
        zHcannot inherit from both a TypedDict type and a non-TypedDict base classc3�@K�|]}t|t��V��dSr)r�rr�s  rr�z)_TypedDictMeta.__new__.<locals>.<genexpr>�s,����5�5�!�z�!�W�%�%�5�5�5�5�5�5rr
r�z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typec�F��i|]\}}|t|��j�����S)rY)r�r�)r�r9r�r��tp_dicts   ��rr�z*_TypedDictMeta.__new__.<locals>.<dictcomp>�sA���
�
�
���2�
�{�2�s�7�+=�>�>�>�
�
�
r�__required_keys__�__optional_keys__rTFz,Required keys overlap with optional keys in z: required_keys=z, optional_keys=�	__total__)rxr�rr�r�rOr�r�r�r�updater�r\rr[rjrfr��discard�
isdisjointr�r`rbrcr�rd)r�rcr!rP�totalr��generic_baser��own_annotations�
required_keys�
optional_keys�
base_required�
base_optional�annotation_key�annotation_type�annotation_origin�annotation_args�is_requiredr�ras                  @@rrOz_TypedDictMeta.__new__�sC�����	B�	B�D��D�z�z��/�/�D��4G�4G��!A�B�B�B���5�5�u�5�5�5�5�5�	�#�:�L�L��L��,�,�~�t�5J�|�5J�T�5J�5J�B�O�O�����&�&�!2�B�7�7��O��
�
�
�
�
�(�.�.�0�0�
�
�
�����
����
��		+�		+�D����t�}�0�0�1B�B�G�G�H�H�H� �M�-�-�.A�3�5�5�I�I�M��]�*�M��]�*�M� �M�-�-�.A�3�5�5�I�I�M��]�*�M��]�*�M�M����?�+�+�+�/>�/D�/D�/F�/F�	6�	6�+�N�O� *�?� ;� ;�� �I�-�-�"*�?�";�";��"�D�&5�a�&8�O�(2�?�(C�(C�%� �H�,�,�"���"�k�1�1�#���#���
6��!�!�.�1�1�1��%�%�n�5�5�5�5��!�!�.�1�1�1��%�%�n�5�5�5�5��'�'�
�6�6�	
�	
�
3�4�
3�
3��
3�
3�"/�
3�
3�	
�	
�6�#.���$-�m�$<�$<��!�$-�m�$<�$<��!��w��,�,�	&� %�G���rc� �td���)Nz4TypedDict does not support instance and class checksr�)r�r1s  rr=z _TypedDictMeta.__subclasscheck__�s���N�O�O�OrN)T)r�r�r�rOr�r-r=r9r
rrr�r��sJ������I�I�I�I�V�H�P�P�P�*���rr��rhc���|�|}n|rtd���|rtjdtd���dt	|��i}t��}|�||d<t
|d||�	��S)
a*A simple typed namespace. At runtime it is equivalent to a plain dict.

    TypedDict creates a dictionary type such that a type checker will expect all
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime.

    Usage::

        >>> class Point2D(TypedDict):
        ...     x: int
        ...     y: int
        ...     label: str
        ...
        >>> a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        >>> b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check
        >>> Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')
        True

    The type info can be accessed via the Point2D.__annotations__ dict, and
    the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets.
    TypedDict supports an additional equivalent form::

        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality::

        class Point2D(TypedDict, total=False):
            x: int
            y: int

    This means that a Point2D TypedDict can have any of the keys omitted. A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.

    The Required and NotRequired special forms can also be used to mark
    individual keys as being required or not required::

        class Point2D(TypedDict):
            x: int               # the "x" key must always be present (Required is the default)
            y: NotRequired[int]  # the "y" key can be omitted

    See PEP 655 for more details on Required and NotRequired.
    Nz@TypedDict takes either a dict or keyword arguments, but not bothz�The kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.r���
stacklevelr�r�r
ru)r��warnings�warn�DeprecationWarningr�r�r�)rTr>rhrPrPrvs      rrMrM�s���^�~����	�)��(�)�)�	)�
�
��
�
7�
��	
�	
�	
�	
��T�&�\�\�	*�B�
�Y�Y�F�
��!��<���(�B��%�8�8�8�8rrMc��tfSr)�
_TypedDictr[s r�<lambda>r~@s��:�-�rc�T�t||j�d���}t||f��S)a�Special typing construct to mark a TypedDict key as required.

    This is mainly useful for total=False TypedDicts.

    For example::

        class Movie(TypedDict, total=False):
            title: Required[str]
            year: int

        m = Movie(
            title='The Matrix',  # typechecker error if key is omitted
            year=1999,
        )

    There is no runtime checking that a required key is actually provided
    when instantiating a related TypedDict.
    � accepts only a single type.�r�rr�rZs   rrjrjCs0��(�z�d�j�#N�#N�#N�O�O�D����w�'�'�'rc�T�t||j�d���}t||f��S)a7Special typing construct to mark a TypedDict key as potentially missing.

    For example::

        class Movie(TypedDict):
            title: str
            year: NotRequired[int]

        m = Movie(
            title='The Matrix',  # typechecker error if key is omitted
            year=1999,
        )
    r�r�rZs   rrfrf[s0���z�d�j�#N�#N�#N�O�O�D����w�'�'�'rc�:�eZdZdZeZd�Zd�Zd�Zd�Z	d�Z
d�ZdS)	rba+NewType creates simple unique types with almost zero runtime overhead.

    NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy callable that simply returns its argument.

    Usage::

        UserId = NewType('UserId', int)

        def name_by_id(user_id: UserId) -> str:
            ...

        UserId('user')          # Fails type check

        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK

        num = UserId(5) + 1     # type: int
    c��||_d|vr|�d��d}||_||_t	��}|dkr	||_dSdS)Nrr�r�)r��
rpartitionr��
__supertype__r�r�)rrcr�r�s    rrzNewType.__init__�s_�� ����$�;�;��?�?�3�'�'��+�D���
�����)�)���h���%�D�O�O�O��rc�6��|j�G�fd�d��}|fS)Nc���eZdZ�fd�ZdS)�&NewType.__mro_entries__.<locals>.Dummyc	�D��|j}td|�d|�d��d����)NzGCannot subclass an instance of NewType. Perhaps you were looking for: `z = NewType(r/z)`)r�r�)r��
subclass_name�superclass_names  �rrz8NewType.__mro_entries__.<locals>.Dummy.__init_subclass__�sU��� #��
��Y�%�Y�Y�2?�Y�Y�ET�Y�Y�Y���rN)r�r�r�r)r�s�r�Dummyr��s.�������
�
�
�
�
�
�
rr�r�)rr!r�r�s   @rr"zNewType.__mro_entries__�sG����-��	�	�	�	�	�	�	�	�	�	��x�rc�$�|j�d|j��S)Nr)r�r�rs rr'zNewType.__repr__�s���/�7�7�D�$5�7�7�7rc��|jSr)r�rs rr*zNewType.__reduce__�s��� � rc� �t||fSrr/r0s  rr2zNewType.__or__�r3rc� �t||fSrr/r0s  rr5zNewType.__ror__�r6rN)r�r�r�rr
r-rr"r'r*r2r5r
rrrbrbns��������*�H�&�&�&�
�
�
�8�8�8�!�!�!�"�"�"�"�"�"�"�"rrbc��eZdZdZdZeedefd�����Zeedefd�����Z	ed$d���Z
eedefd�����Zede
fd	���Zed$d
���Zedefd���Zed%d
e
defd���Zedefd���Zed%de
defd���Zed%de
deefd���Zed&de
de
de
fd���Zedefd���Zede
fd���Zed'de
de
fd���Zedefd���Zedede
fd���Zedeeddfd ���Zed(d"���Zed$d#���ZdS))rPa�Generic base class for TextIO and BinaryIO.

    This is an abstract, generic version of the return of open().

    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    r
r�c��dSrr
rs r�modezIO.mode��	��	
�rc��dSrr
rs rrczIO.name�r�rNc��dSrr
rs r�closezIO.close�rrc��dSrr
rs r�closedz	IO.closed�r�rc��dSrr
rs r�filenoz	IO.fileno�rrc��dSrr
rs r�flushzIO.flush�rrc��dSrr
rs r�isattyz	IO.isatty�rrr�r9c��dSrr
)rr9s  r�readzIO.read�rrc��dSrr
rs r�readablezIO.readable�rr�limitc��dSrr
)rr�s  r�readlinezIO.readline�rr�hintc��dSrr
)rr�s  r�	readlineszIO.readlines�rrr�offset�whencec��dSrr
)rr�r�s   r�seekzIO.seek�rrc��dSrr
rs r�seekablezIO.seekable�rrc��dSrr
rs r�tellzIO.tell�rr�sizec��dSrr
)rr�s  r�truncatezIO.truncate�rrc��dSrr
rs r�writablezIO.writable
rrrMc��dSrr
�rrMs  r�writezIO.write
rr�linesc��dSrr
)rr�s  r�
writelinesz
IO.writelines

rr�
IO[AnyStr]c��dSrr
rs r�	__enter__zIO.__enter__
rrc��dSrr
)rrxr��	tracebacks    r�__exit__zIO.__exit__
rr)r�N)r�r5r)r�r�) r�r�r�rrr�rrzr�rcr�r�r�rr�r�r�rTr�r�r�rHr�r�r�r�r�r�r�r�r�r�r
rrrPrP�s�������
�
��I�
��
�c�
�
�
��^��X�
���
�c�
�
�
��^��X�
��
�
�
��^�
���
��
�
�
��^��X�
��
��
�
�
��^�
��
�
�
��^�
��
��
�
�
��^�
��
�
�c�
�6�
�
�
��^�
��
�$�
�
�
��^�
��
�
�c�
�6�
�
�
��^�
��
�
�c�
�4��<�
�
�
��^�
��
�
�3�
��
�C�
�
�
��^�
��
�$�
�
�
��^�
��
�c�
�
�
��^�
��
�
�S�
�C�
�
�
��^�
��
�$�
�
�
��^�
��
�v�
�#�
�
�
��^�
��
��V��
��
�
�
��^�
��
�
�
��^�
��
�
�
��^�
�
�
rrPc�^�eZdZdZdZedeeefde	fd���Z
edd���ZdS)	rOz5Typed version of the return of open() in binary mode.r
rMr�c��dSrr
r�s  rr�zBinaryIO.write
rrc��dSrr
rs rr�zBinaryIO.__enter__ 
rrN)r�rO)r�r�r�rrrr"r*�	bytearrayrr�r�r
rrrOrO
su������?�?��I��
�u�U�I�-�.�
�3�
�
�
��^�
��
�
�
��^�
�
�
rrOc��eZdZdZdZeedefd�����Zeede	fd�����Z
eedee	fd�����Zeede
fd�����Zeedefd�����Zedd	���Zd
S)rSz3Typed version of the return of open() in text mode.r
r�c��dSrr
rs r�bufferz
TextIO.buffer*
r�rc��dSrr
rs r�encodingzTextIO.encoding/
r�rc��dSrr
rs r�errorsz
TextIO.errors4
r�rc��dSrr
rs r�line_bufferingzTextIO.line_buffering9
r�rc��dSrr
rs r�newlineszTextIO.newlines>
r�rc��dSrr
rs rr�zTextIO.__enter__C
rrN)r�rS)r�r�r�rrr�rrOr�rzr�rr�r�r�rr�r�r
rrrSrS%
s6������=�=��I�
��
��
�
�
��^��X�
���
�#�
�
�
��^��X�
���
���
�
�
�
��^��X�
���
��
�
�
��^��X�
���
�#�
�
�
��^��X�
��
�
�
��^�
�
�
rrSc���eZdZ�fd�Z�xZS)�_DeprecatedTypec���|dvr5||jvr,tj|j�d|j�d�td���t���|��S)N>rr�r�z5 is deprecated, import directly from typing instead. z  will be removed in Python 3.12.r�rw)r�ryrzr�r{rG�__getattribute__)r�rcrHs  �rr�z _DeprecatedType.__getattribute__I
sy����<�<�<����AU�AU��M��<�"�"�(+��"�"�"�#��
�
�
�
��w�w�'�'��-�-�-r)r�r�r�r�rKrLs@rr�r�H
s8�������	.�	.�	.�	.�	.�	.�	.�	.�	.rr�c�&�eZdZdZgd�ZeZeZeZdS)�ioz)Wrapper namespace for IO generic classes.)rPrSrON)r�r�r�r�__all__rPrSrOr
rrr�r�U
s.������3�3�*�*�*�G�	�B�
�F��H�H�Hrr�z.ioc�"�eZdZdZddgZeZeZdS)�rez&Wrapper namespace for re type aliases.rRrQN)r�r�r�rr�rRrQr
rrr�r�d
s(������0�0��'�"�G��G��E�E�Err�z.rer�c�f�tdt|��j��tj���|S)a�Ask a static type checker to reveal the inferred type of an expression.

    When a static type checker encounters a call to ``reveal_type()``,
    it will emit the inferred type of the argument::

        x: int = 1
        reveal_type(x)

    Running a static type checker (e.g., mypy) on this example
    will produce output similar to 'Revealed type is "builtins.int"'.

    At runtime, the function prints the runtime type of the
    argument and returns the argument unchanged.
    zRuntime type is )�file)�printrxr�r��stderrr�s rrkrkp
s0��
�
3�T�#�Y�Y�/�
3�
3�#�*�E�E�E�E��Jr)�
eq_default�
order_default�kw_only_default�field_specifiersr�r�r�r�.rPc�"�����������fd�}|S)a�Decorator to mark an object as providing dataclass-like behaviour.

    The decorator can be applied to a function, class, or metaclass.

    Example usage with a decorator function::

        T = TypeVar("T")

        @dataclass_transform()
        def create_model(cls: type[T]) -> type[T]:
            ...
            return cls

        @create_model
        class CustomerModel:
            id: int
            name: str

    On a base class::

        @dataclass_transform()
        class ModelBase: ...

        class CustomerModel(ModelBase):
            id: int
            name: str

    On a metaclass::

        @dataclass_transform()
        class ModelMeta(type): ...

        class ModelBase(metaclass=ModelMeta): ...

        class CustomerModel(ModelBase):
            id: int
            name: str

    The ``CustomerModel`` classes defined above will
    be treated by type checkers similarly to classes created with
    ``@dataclasses.dataclass``.
    For example, type checkers will assume these classes have
    ``__init__`` methods that accept ``id`` and ``name``.

    The arguments to this decorator can be used to customize this behavior:
    - ``eq_default`` indicates whether the ``eq`` parameter is assumed to be
        ``True`` or ``False`` if it is omitted by the caller.
    - ``order_default`` indicates whether the ``order`` parameter is
        assumed to be True or False if it is omitted by the caller.
    - ``kw_only_default`` indicates whether the ``kw_only`` parameter is
        assumed to be True or False if it is omitted by the caller.
    - ``field_specifiers`` specifies a static list of supported classes
        or functions that describe fields, similar to ``dataclasses.field()``.
    - Arbitrary other keyword arguments are accepted in order to allow for
        possible future extensions.

    At runtime, this decorator records its arguments in the
    ``__dataclass_transform__`` attribute on the decorated object.
    It has no other runtime effect.

    See PEP 681 for more details.
    c�"�������d�|_|S)N)r�r�r�r�rP)�__dataclass_transform__)�	cls_or_fnr�r�r�rPr�s �����rr�z&dataclass_transform.<locals>.decorator�
s)���$�*�.� 0��-
�-
�	�)��rr
)r�r�r�r�rPr�s````` rrYrY�
s=�������L����������rrr�)rar�)r�)NNF)r
)�rr�rrr�r�collections.abcr�r�r�r��	stdlib_rer�r�ryrrrr	�_typingr
�ImportErrorr�r|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r`r�rr	rr�rBrxrErrerarmr`rrr"rrrprrqrr�r�r�r�r�r r!rhrirr�r�r�r;rJrPrXr�rhr�r�rrrmrr�_TYPING_INTERNALS�_SPECIAL_NAMESr�r�r�r�r�r�r�r�rr�rrlrWrUr��BuiltinFunctionTyper�r�r�r^r�r\r[r_r�rVrcrdr�partialr�rrgr]rXrZrrrrrrrrr*rzrT�_aliasr'r4r7r6r5r)r*r;r2r%r8rrJr#r0r,r.r1r/r$r�rr�rH�dequerErrKr-r+r(r3r�r&r�r:rFrGrIrDrCrNr9rrAr?r>r=r@r<rBr@rRrSrIrLrOrLr\r"r�rMr}rjrfrbrnrorPrOrSr�r�r�r�rRrQrkrYr
rr�<module>r�sh����*(�'�'�'�'�'�'�'�����#�#�#�#�#�#���������������������
�
�
�
���������^�^�^�^�^�^�^�^�^�^�^�^�����������������������
m�m�m��h�5�������PU������B@�@�@�
���0���*���B
<�
<�
<����16�/�/�/�/�/����	�	�	�
A�
A�
A� ���
�	��U������.6?�Y�[�[�
�
�
�
�DF�F�F�F�F�F�F�F�	�	�	�	�	�	�	�	���������((/�(/�(/�(/�(/�6�<�t�(/�(/�(/�(/�V0�0�0�0�0�,�d�0�0�0�0�	"�	"�	"�	"�	"�t�	"�	"�	"�$�$�$�$�$�H�$�$�$�$�$�4�4���4�(�4�4���4�0�4�4���4�&�4�4���4�4�(�(���(�*�(�(���(�*�)0�)0���)0�V�"�"���"�
�
������2�2�����2�B�
4�
4���
4� �;�;���;�4�.(�.(���.(�bQD�QD�QD�QD�QD��t�QD�QD�QD�QD�hF��F��F�F�F�F�
O��O��O�O�O�O���������"&�"&�"&�"&�"&�"&�"&�"&�JA�A�A�A�A�f�j�"5�7L��A�A�A�A�HL
�L
�L
�L
�L
�6�:�'<�D�L
�L
�L
�L
�^3�3�3�3�3�F�J�d�3�3�3�3�03�3�3�3�3�f�j��3�3�3�3�0J�J�J�J�J��
�$7�9N��J�J�J�J�X9�9�9�CT�CT�CT�CT�CT��d�CT�CT�CT�CT�bZ�Z�Z�Z�Z�%�T�Z�Z�Z�Z�B)!�)!�)!�)!�)!�<�):�$�)!�)!�)!�)!�V2�2�2�2�2�L�-�t�2�2�2�2�"&�&�&�&�&�(��&�&�&�&�D&�&�&�&�&�%�T�&�&�&�&�"#�"#�"#�"#�"#��}�D�"#�"#�"#�"#�J.�.�.�D�D�D�D�D�=��D�D�D�D�)�)�)�)�)�}�D�)�)�)�)��:�:���:�D:�:�:�:�:�-�t�:�:�:�:�8i*�i*�i*�i*�i*�i*�i*�i*�X3�3�3�3�3�3�3�3�J�J�J��J�J�J��
(�.�8�<U�;V�V�����"X�X�X�
(�(�(�:����8�8�8�8����,�-J�K����3�3�3�3�3�G�3�3�3�8c4�c4�c4�c4�c4�w�-�c4�c4�c4�c4�L.)�.)�.)�.)�.)�l�M��.)�.)�.)�.)�bI
�I
�I
�I
�I
�I
�I
�I
�X���4���
�
�
� �$�e�&?��"�E�$4�'�):�<P�R��
`]�`]�`]�`]�F
�
�
�2���<���4*�*�*�$!$��O�e�O�5�O�O�O�O�2!�!�!�H���:�:�:�!�[�!2��!2�;��!E�!E�F�F��&�&�&�R	3�	3�	3����
!
�!
�!
�L�G�C�L�L���W�T�]�]���W�T�]�]���w�v��&�&�&���w�v��&�&�&�����4�(�(�(���7�:�T�2�2�2�����4�t�4�4�4��
���5�#�	&�	&��
���6�+�/�*�A�.�.���F�;�?�,�a�0�0�	��F�;�?�,�a�0�0�	���{��4�a�8�8�
���{��4�a�8�8�
��6�+�/�*�A�.�.���6�+�/�*�A�.�.��
�V�K�O�.��
2�
2�
���{��$�a�(�(���F�;�?�,�a�0�0�	�
�V�K�O�.��
2�
2�
��=���1�1�5�5���	���f�[�_�(�!�-�@�@�@��
�V�K�O�.��
2�
2�
�
�&���(�!�
,�
,������6��:�:���6�+�/�*�A�.�.���&���8�!�<�<��
�V�K�O�.��
2�
2�
��
�5�"�5�w�7�7�7��	��
��v�d�A�E��/�/�/����{� �!�'�2�2�2���f�S�!�%�e�,�,�,���F�9�a�e�+�>�>�>�	��f�[�_�0�!�4�4���6�+�/�*�A�.�.���F�;�?�,�a�0�0�	�
�V�K�O�.��
2�
2�
���
�9�1�CS�T�T�T���f�Z�C�Q�Mb�c�c�c��
�v�d�A�E��/�/�/���f�[�,�a�m�D�D�D���f�[�,�a�0�0��
�&��$�a�
(�
(���6�+�&��*�*���F�;�?�,�a�0�0�	�����6��:�:��
�v�d�A�E��/�/�/�����4�
�
�
�
�
�(�
�
���
��
�
�
�
�
�H�
�
���
��
�
�
�
�
�h�
�
���
��
�
�
�
�
�H�
�
���
��
�
�
�
�
�H�
�
���
��
�
�
�
�
�(�4�.�
�
���
��
�
�
�
�
�H�T�N�
�
���
������i�D�D�D�E�E���9�B�B�B�C�C��!�!�!�!�!�T�!�!�!�H=�=�=�=�6�l�l�>�<��R�@�@�����5�
��R*�R*�R*�R*�R*�T�R*�R*�R*�jC9��C9�C9�C9�C9�C9�J�\�\�.�+�r�2�
>�
>�
�7�7�	���(�(���(�.�(�(���(�$;"�;"�;"�;"�;"�;"�;"�;"�~���
�`
�`
�`
�`
�`
����`
�`
�`
�F
�
�
�
�
�r�%�y�
�
�
� 
� 
� 
� 
� 
�R��W� 
� 
� 
�F
.�
.�
.�
.�
.�d�
.�
.�
.������?�������������B�K��
�&��"�A�
&�
&����y���"�"�������?�������������B�K���Q��a�����*��!�CE�O�O�O��O��O��	O�
�D��I���c��(:�:�C�?�@�O��
O��q�c�1�f��O�O�O�O�O�Os�A	�	A�A