Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
root_model.cpython-313.pyc61 linesDownload Raw Back to __pycache__
1�

2��j���:�SrSSKJr SSKJrJr SSKJrJrJ	r	J3r4Jr SSKJ
r
 SSKJrJr SSKJr SS	KJrJr SS5KJrJr \(a.SSKJr SSKJr \"S
\\4S9"SS\R<55rO\R<rSr \"S5r!"SS\\	\!\S9r"g)z%RootModel class and type definitions.�)�annotations)�copy�deepcopy)�
TYPE_CHECKING�Any�Generic�Literal�TypeVar)�PydanticUndefined)�Self�dataclass_transform�)�PydanticUserError)�_model_construction�_repr)�	BaseModel�_object_setattr)�Field)�PrivateAttrF)�kw_only_default�field_specifiersc��\rSrSrSrg)�_RootModelMetaclass��N)�__name__�6__module__�__qualname__�__firstlineno__�__static_attributes__r��YD:\code\apps\devtools\python\user_packages\Python313\site-packages\pydantic/root_model.pyrrs��CFr!r)�	RootModel�RootModelRootTypec
�.^�\rSrSr%SrSrSrSrS\S'U4Sjr	\74SSjjrS\l\
SSU4S	jjj5rSS8jrSSjrSSjrSSS
jjr\(a-SSSSSSSSSSSSS.SSjjrSU4SjjrSSjrSrU=r$)r#� a�!!! abstract "Usage Documentation"9    [`RootModel` and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)10 11A Pydantic `BaseModel` for the root object of the model.12 13Attributes:14    root: The root object of the model.15    __pydantic_root_model__: Whether the model is a RootModel.16    __pydantic_private__: Private fields in the model.17    __pydantic_extra__: Extra fields in the model.18 19TNr$�rootc�v>�URRS5nUb20[SSS9e[TU]"S0UD6 g)N�extraz<`RootModel` does not support setting `model_config['extra']`zroot-model-extra)�coder)�model_config�getr�super�__init_subclass__)�cls�kwargsr)�	__class__s   �r"r.�RootModel.__init_subclass__4sD���� � �$�$�W�-����#�N�Ug��
�	��!�+�F�+r!c�t�SnU(aU[La[S5eUnURRXS9 g)NTz_"RootModel.__init__" accepts either a single positional argument or arbitrary keyword arguments)�
self_instance)r�21ValueError�__pydantic_validator__�validate_python)�selfr'�data�__tracebackhide__s    r"�__init__�RootModel.__init__<sB�� ����,�,� �u����D��#�#�3�3�D�3�Mr!c�>�[TU]XS9$)aCreate a new model using the provided root object and update fields set.22 23Args:24    root: The root object of the model.25    _fields_set: The set of fields to be updated.26 27Returns:28    The new model.29 30Raises:31    NotImplemented: If the model is not a subclass of `RootModel`.32)r'�_fields_set)r-�model_construct)r/r'r>r1s   �r"r?�RootModel.model_constructHs����w�&�D�&�J�Jr!c�4�URURS.$)N��__dict__�__pydantic_fields_set__rB�r8s r"�__getstate__�RootModel.__getstate__Xs���
�
�'+�'C�'C�33�	34r!c�D�[USUS5 [USUS5 g)NrDrC)r)r8�states  r"�__setstate__�RootModel.__setstate__^s&����7��?X�9Y�Z���j�%�35�*;�<r!c���[U5nURU5n[UR5n[URS5US'[	USU5 [	US[UR3655 U$)z$Returns a shallow copy of the model.r'rCrD)�type�__new__rrCrrD)r8r/�m�new_dicts    r"�__copy__�RootModel.__copy__bsh���4�j���K�K������
�
�&����
�
�f� 5�6������:�x�0���4�d�4�;W�;W�6X�Y��r!c	��[U5nURU5n[US[URUS95 [US[UR55 U$)z!Returns a deep copy of the model.rC)�memorD)rMrNrrrCrrD)r8rTr/rOs    r"�__deepcopy__�RootModel.__deepcopy__lsO���4�j���K�K������:�x��
�
�D�'I�J�	��4�d�4�;W�;W�6X�Y��r!�pythonF)�mode�include�exclude�context�by_alias�
exclude_unset�exclude_defaults�exclude_none�exclude_computed_fields�37round_trip�warnings�serialize_as_anyc��g)a�This method is included just to get a more accurate return type for type checkers.38It is included in this `if TYPE_CHECKING:` block since no override is actually necessary.39 40See the documentation of `BaseModel.model_dump` for more details about the arguments.41 42Generally, this method will have a return type of `RootModelRootType`, assuming that `RootModelRootType` is43not a `BaseModel` subclass. If `RootModelRootType` is a `BaseModel` subclass, then the return44type will likely be `dict[str, Any]`, as `model_dump` calls are recursive. The return type could45even be something different, in the case of a custom serializer.46Thus, `Any` is used here to catch all of these cases.47Nr)
r8rXrYrZr[r\r]r^r_r`rarbrcs
             r"�48model_dump�RootModel.model_dumpxs��6
r!c��>�[U[5(d[$URSRURSR:H=(a [49TU]U5$�Nr')�50isinstancer#�NotImplemented�__pydantic_fields__�51annotationr-�__eq__)r8�otherr1s  �r"rm�RootModel.__eq__�sZ����%��+�+�!�!��'�'��/�:�:�e�>W�>W��?52�53�*��/�����.�	/r!c#�,# �SUR4v� g7frh)r'rEs r"�
__repr_args__�RootModel.__repr_args__�s����d�i�i���s�r)r'r$�return�None)N)r'r$r>zset[str] | Nonersr)rs�dict[Any, Any])rIrursrt)rsr)rTzdict[int, Any] | Nonersr)rXzLiteral['json', 'python'] | strrYrrZrr[zdict[str, Any] | Noner\zbool | Noner]�boolr^rvr_rvr`rvrarvrbz'bool | Literal['none', 'warn', 'error']rcrvrsr)rnrrsrv)rsz_repr.ReprArgs)rrrr�__doc__�__pydantic_root_model__�__pydantic_private__�__pydantic_extra__�__annotations__r.rr;�__pydantic_base_init__�classmethodr?rFrJrQrUrrermrqr �
__classcell__)r1s@r"r#r# s,����#������54��,�5F�N�'+�H�#��
K�
K��
K�55�=����565=���-1�$(�"'�%*�!&�,1�$�@D�%*�	�2�	��		�57�	�+�
	�"�	� �	�#�	��	�&*�	��	�>�	�#�	��	�:/� � r!r#)�	metaclassN)#rw�58__future__r�_annotationsrr�typingrrrr	r59�
pydantic_corer�typing_extensionsrr
�r�	_internalrr�mainrr�fieldsr�PydanticModelFieldr�PydanticModelPrivateAttr�ModelMetaclassr�__all__r$r#rr!r"�<module>r�s���+�2��@�@�+�7��1�,��3�?�60��BT�Vn�Ao�p�F�1�@�@�F�q�F�-�<�<��61���/�0��} �	�7�#4�5�AT�} r!
codekingpro/portable-devtools · Team Ai