Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/pydantic/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/pydantic/__pycache__/dataclasses.cpython-311.pyc

�

Te�e�,�
�>�dZddlmZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
mZddlmZmZmZddlmZmZmZddlmZdd	lmZdd
lmZddlmZerddlm Z d
Z!e
d��Z"ej#dkrceej$ef���eddddddddddd�
dEd%�����Z%eej$ef���eddddddddddd�
dFd)�����Z%n^eej$ef���eddddddddd*�dGd+�����Z%eej$ef���eddddddddd*�dHd,�����Z%eej$ef���	dIddddddddddd�
dJd/���Z%ee&��Z'd0ej#cxkrd1krnndKd6�Z(e(ej)_*ddd7dd8�dLd@�Z+dMdD�Z,dS)Nz7Provide an enhanced dataclass that performs validation.�)�annotationsN)�
TYPE_CHECKING�Any�Callable�Generic�NoReturn�TypeVar�overload)�Literal�	TypeGuard�dataclass_transform�)�_config�_decorators�
_typing_extra)�_dataclasses)�getattr_migration)�
ConfigDict)�Field)�PydanticDataclass)�	dataclass�rebuild_dataclass�_T���
)�field_specifiersFT.�
�init�repr�eq�order�unsafe_hash�frozen�config�validate_on_init�kw_only�slotsr�Literal[False]r �boolr!r"r#r$r%� ConfigDict | type[object] | Noner&�bool | Noner'r(�return�-Callable[[type[_T]], type[PydanticDataclass]]c
��dS�N�rs
          �I/opt/cloudlinux/venv/lib/python3.11/site-packages/pydantic/dataclasses.pyrrs	��	���_cls�type[_T]�type[PydanticDataclass]c
��dSr0r1)r4rr r!r"r#r$r%r&r'r(s           r2rr+s	�� 	�r3�rr r!r"r#r$r%r&c��dSr0r1r8s        r2rr?s	��	�r3c��dSr0r1)	r4rr r!r"r#r$r%r&s	         r2rrNs	��	�r3�type[_T] | None�GCallable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass]c
����������|dus
Jd���|dus
Jd���tjdkrt|	|
����ni�d�������fd
�}|�|S||��S)
a2Usage docs: https://docs.pydantic.dev/2.4/concepts/dataclasses/

    A decorator used to create a Pydantic-enhanced dataclass, similar to the standard Python `dataclass`,
    but with added validation.

    This function should be used similarly to `dataclasses.dataclass`.

    Args:
        _cls: The target `dataclass`.
        init: Included for signature compatibility with `dataclasses.dataclass`, and is passed through to
            `dataclasses.dataclass` when appropriate. If specified, must be set to `False`, as pydantic inserts its
            own  `__init__` function.
        repr: A boolean indicating whether or not to include the field in the `__repr__` output.
        eq: Determines if a `__eq__` should be generated for the class.
        order: Determines if comparison magic methods should be generated, such as `__lt__`, but not `__eq__`.
        unsafe_hash: Determines if an unsafe hashing function should be included in the class.
        frozen: Determines if the generated class should be a 'frozen' `dataclass`, which does not allow its
            attributes to be modified from its constructor.
        config: A configuration for the `dataclass` generation.
        validate_on_init: A deprecated parameter included for backwards compatibility; in V2, all Pydantic dataclasses
            are validated on init.
        kw_only: Determines if `__init__` method parameters must be specified by keyword only. Defaults to `False`.
        slots: Determines if the generated class should be a 'slots' `dataclass`, which does not allow the addition of
            new attributes after instantiation.

    Returns:
        A decorator that accepts a class as its argument and returns a Pydantic `dataclass`.

    Raises:
        AssertionError: Raised if `init` is not `False` or `validate_on_init` is `False`.
    Fz7pydantic.dataclasses.dataclass only supports init=Falsez-validate_on_init=False is no longer supportedr)r'r(�cls�	type[Any]r-r6c
�.��|}�
}|�t|dd��}|�|}tj|��}tj�|��}|j}tj|��rLd}|f}t|t��rt|j}||fz}tj
|j|��}tj|fd�����d��
��}||_||_|j|_|j|_tj||dd���}	|	|_|S)z�Create a Pydantic dataclass from a regular dataclass.

        Args:
            cls: The class to create the Pydantic dataclass from.

        Returns:
            A Pydantic dataclass.
        N�__pydantic_config__T)rr r!r"r#r$F��raise_errors�types_namespace)�getattrr�
ConfigWrapperr�DecoratorInfos�build�__doc__�_pydantic_dataclasses�is_builtin_dataclass�
issubclassr�__parameters__�types�	new_class�__name__�dataclassesr�__pydantic_decorators__�
__module__�__qualname__�complete_dataclass�__pydantic_complete__)r>�original_cls�config_dict�
cls_config�config_wrapper�
decorators�original_doc�bases�generic_base�pydantic_completer%r!r$�kwargsr"r r#s          �������r2�create_dataclassz#dataclass.<locals>.create_dataclass�sU��������� ��&;�T�B�B�J��%�(�� �.�{�;�;�� �/�5�5�c�:�:�
�
�{�� �5�c�:�:�	7� �L�
�F�E��#�w�'�'�
0�&�s�'9�:�����/���/�#�,��6�6�C��#��

�����#��

�

��

�

��'1��#�"���%�0���'�4���1�D���e�T�
�
�
��%6��!��
r3N)r>r?r-r6)�sys�version_info�dict)
r4rr r!r"r#r$r%r&r'r(rar`s
  ``````    @r2rr_s����������\�5�=�=�=�S�=�=�=��5�(�(�(�*Y�(�(�(�
��7�"�"��g�U�3�3�3�����;�;�;�;�;�;�;�;�;�;�;�;�z�|�����D�!�!�!r3)r�)r��argsrr`rc� �td���)a9This function does nothing but raise an error that is as similar as possible to what you'd get
        if you were to try calling `InitVar[int]()` without this monkeypatch. The whole purpose is just
        to ensure typing._type_check does not error if the type hint evaluates to `InitVar[<parameter>]`.
        z 'InitVar' object is not callable)�	TypeError)rgr`s  r2�
_call_initvarrj�s��
�:�;�;�;r3�)�forcerC�_parent_namespace_depth�_types_namespacer>rlrCrm�intrn�dict[str, Any] | Nonec��|s	|jrdS|�|���}n7|dkrtj|���pi}|}ni}tj||��}tj|tj|j	d���||���S)a}Try to rebuild the pydantic-core schema for the dataclass.

    This may be necessary when one of the annotations is a ForwardRef which could not be resolved during
    the initial attempt to build the schema, and automatic rebuilding fails.

    This is analogous to `BaseModel.model_rebuild`.

    Args:
        cls: The class to build the dataclass core schema for.
        force: Whether to force the rebuilding of the model schema, defaults to `False`.
        raise_errors: Whether to raise errors, defaults to `True`.
        _parent_namespace_depth: The depth level of the parent namespace, defaults to 2.
        _types_namespace: The types namespace, defaults to `None`.

    Returns:
        Returns `None` if the schema is already "complete" and rebuilding was not required.
        If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`.
    Nr)�parent_depthF)�checkrB)
rV�copyr�parent_frame_namespace�get_cls_types_namespacerJrUrrFrA)r>rlrCrmrnrD�frame_parent_nss       r2rr�s���4�
�S�.�
��t��'�5E�5J�5J�5L�5L�O�O�&��*�*�"/�"F�Tk�"l�"l�"l�"r�pr��#2���"$��+�C�C��Y�Y�O�$�7���!�#�"9��G�G�G�%�+�	
�
�
�	
r3�__clsr?�"TypeGuard[type[PydanticDataclass]]c�<�tj|��od|jvS)z�Whether a class is a pydantic dataclass.

    Args:
        __cls: The class.

    Returns:
        `True` if the class is a pydantic dataclass, `False` otherwise.
    �__pydantic_validator__)rQ�is_dataclass�__dict__)rxs r2�is_pydantic_dataclassr~s"���#�E�*�*�Y�/G�5�>�/Y�Yr3)rr)r r*r!r*r"r*r#r*r$r*r%r+r&r,r'r*r(r*r-r.)r4r5rr)r r*r!r*r"r*r#r*r$r*r%r+r&r,r'r*r(r*r-r6)rr)r r*r!r*r"r*r#r*r$r*r%r+r&r,r-r.)r4r5rr)r r*r!r*r"r*r#r*r$r*r%r+r&r,r-r6r0)r4r;rr)r r*r!r*r"r*r#r*r$r*r%r+r&r,r'r*r(r*r-r<)rgrr`rr-r)r>r6rlr*rCr*rmrornrpr-r,)rxr?r-ry)-rI�
__future__r�_annotationsrQrbrN�typingrrrrrr	r
�typing_extensionsrrr
�	_internalrrrrrJ�
_migrationrr%r�fieldsr�_internal._dataclassesr�__all__rrc�fieldrrP�__getattr__rj�InitVar�__call__rr~r1r3r2�<module>r�s���=�=�2�2�2�2�2�2�����
�
�
�
�����U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�E�E�E�E�E�E�E�E�E�E�:�:�:�:�:�:�:�:�:�:�<�<�<�<�<�<�)�)�)�)�)�)��������������:�9�9�9�9�9�9�
*���W�T�]�]����w�����;�+<�e�*D�E�E�E�
� %����!��37�(,���
�
�
�
�
��X�F�E�
���;�+<�e�*D�E�E�E�
� %����!��37�(,���������X�F�E���$��;�+<�e�*D�E�E�E�
� %����!��37�(,�������X�F�E����;�+<�e�*D�E�E�E�
� %����!��37�(,�������X�F�E����{�'8�%�&@�A�A�A� �u"�!������/3�$(���u"�u"�u"�u"�u"�B�A�u"�p ���)�)��	�S�
�'�'�'�'��'�'�'�'�'�<�<�<�<�$1�K�� ���#$�.2�
.
�.
�.
�.
�.
�.
�b	Z�	Z�	Z�	Z�	Z�	Zr3

Hacked By AnonymousFox1.0, Coded By AnonymousFox