HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pydantic/__pycache__/root_model.cpython-310.pyc
o

|��gW�@s�dZddlmZddlZddlmZmZddlmZddl	m
Z
ddlmZm
Z
dd	lmZmZejradd
lmZddlmZmZmZddlmZdd
lmZedeefd�Gdd�dej��ZnejZdZe�d�Z Gdd�deej!e ed�Z"dS)z%RootModel class and type definitions.�)�annotationsN)�copy�deepcopy)�PydanticUndefined�)�PydanticUserError)�_model_construction�_repr)�	BaseModel�_object_setattr)�Any)�Literal�Self�dataclass_transform)�Field)�PrivateAttrF)�kw_only_default�field_specifiersc@seZdZdS)�_RootModelMetaclassN)�__name__�
__module__�__qualname__�rr�>/usr/local/lib/python3.10/dist-packages/pydantic/root_model.pyrsr)�	RootModel�RootModelRootTypecs�eZdZUdZdZdZdZded<�fdd�Ze	fd8d
d�Z
de
_ed9d:�fdd�
�Z
d;dd�Zd<dd�Zd=dd�Zd9d>dd�ZejrUdddddddddddd�d?d0d1�Zd@�fd3d4�ZdAd6d7�Z�ZS)Bra�Usage docs: https://docs.pydantic.dev/2.10/concepts/models/#rootmodel-and-custom-root-types

    A Pydantic `BaseModel` for the root object of the model.

    Attributes:
        root: The root object of the model.
        __pydantic_root_model__: Whether the model is a RootModel.
        __pydantic_private__: Private fields in the model.
        __pydantic_extra__: Extra fields in the model.

    TNr�rootcs6|j�d�}|durtddd��t�jdi|��dS)N�extraz<`RootModel` does not support setting `model_config['extra']`zroot-model-extra)�coder)�model_config�getr�super�__init_subclass__)�cls�kwargsr��	__class__rrr"6s�zRootModel.__init_subclass__�return�NonecKs0d}|r|turtd��|}|jj||d�dS)NTz_"RootModel.__init__" accepts either a single positional argument or arbitrary keyword arguments)�
self_instance)r�
ValueError�__pydantic_validator__�validate_python)�selfr�data�__tracebackhide__rrr�__init__>s�zRootModel.__init__�_fields_set�set[str] | Nonercst�j||d�S)aSCreate a new model using the provided root object and update fields set.

        Args:
            root: The root object of the model.
            _fields_set: The set of fields to be updated.

        Returns:
            The new model.

        Raises:
            NotImplemented: If the model is not a subclass of `RootModel`.
        )rr1)r!�model_construct)r#rr1r%rrr3JszRootModel.model_construct�dict[Any, Any]cCs|j|jd�S)N��__dict__�__pydantic_fields_set__r5�r-rrr�__getstate__Zs�zRootModel.__getstate__�statecCs$t|d|d�t|d|d�dS)Nr7r6)r)r-r:rrr�__setstate__`szRootModel.__setstate__cCs:t|�}|�|�}t|dt|j��t|dt|j��|S)z$Returns a shallow copy of the model.r6r7)�type�__new__rrr6r7)r-r#�mrrr�__copy__ds

zRootModel.__copy__�memo�dict[int, Any] | NonecCs>t|�}|�|�}t|dt|j|d��t|dt|j��|S)z!Returns a deep copy of the model.r6)r@r7)r<r=rrr6rr7)r-r@r#r>rrr�__deepcopy__ls

zRootModel.__deepcopy__�pythonF)�mode�include�exclude�context�by_alias�
exclude_unset�exclude_defaults�exclude_none�
round_trip�warnings�serialize_as_anyrD�Literal['json', 'python'] | strrErrFrG�dict[str, Any] | NonerH�boolrIrJrKrLrM�'bool | Literal['none', 'warn', 'error']rNcCsdS)aThis method is included just to get a more accurate return type for type checkers.
            It is included in this `if TYPE_CHECKING:` block since no override is actually necessary.

            See the documentation of `BaseModel.model_dump` for more details about the arguments.

            Generally, this method will have a return type of `RootModelRootType`, assuming that `RootModelRootType` is
            not a `BaseModel` subclass. If `RootModelRootType` is a `BaseModel` subclass, then the return
            type will likely be `dict[str, Any]`, as `model_dump` calls are recursive. The return type could
            even be something different, in the case of a custom serializer.
            Thus, `Any` is used here to catch all of these cases.
            Nr)r-rDrErFrGrHrIrJrKrLrMrNrrr�
model_dumpxszRootModel.model_dump�othercs2t|t�stS|jdj|jdjkot��|�S�Nr)�
isinstancer�NotImplemented�__pydantic_fields__�
annotationr!�__eq__)r-rTr%rrrZ�s
��
�zRootModel.__eq__�_repr.ReprArgsccs�d|jfVdSrU)rr8rrr�
__repr_args__�s�zRootModel.__repr_args__)rrr'r()N)rrr1r2r'r)r'r4)r:r4r'r()r'r)r@rAr'r)rDrOrErrFrrGrPrHrQrIrQrJrQrKrQrLrQrMrRrNrQr'r)rTrr'rQ)r'r[)rrr�__doc__�__pydantic_root_model__�__pydantic_private__�__pydantic_extra__�__annotations__r"rr0�__pydantic_base_init__�classmethodr3r9r;r?rB�typing�
TYPE_CHECKINGrSrZr\�
__classcell__rrr%rr#s<





�r)�	metaclass)#r]�
__future__r�_annotationsrdrr�
pydantic_corer�r�	_internalrr	�mainr
rrer�typing_extensionsr
rr�fieldsr�PydanticModelFieldr�PydanticModelPrivateAttr�ModelMetaclassr�__all__�TypeVarr�Genericrrrrr�<module>s&