AlkantarClanX12

Your IP : 3.145.112.23


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__/fields.cpython-311.pyc

�

X��eɱ����UdZddlmZddlZddlZddlZddlZddlmZddlm	Z
	ddlmZn
#e
$rdZYnwxYwddlmZmZddlmZddlZddlZdd	lmZdd
lmZmZddlmZdd
lmZmZmZmZmZm Z m!Z!ddl"m#Z#ddlm$Z$ej%rddl&m'Z'ne$Z(eZ)de*d<Gd�dej+d���Z,Gd�de,d���Z-Gd�dej.��Z/ej0deiej1��Gd�d����Z2ej0deiej1��Gd�d����Z3Gd�d ej+��Z4e5deid!d"�d#d�d$d�d%d�d&d�d'd�d(d�d)d�d*d�d+d�d,d�d-d�d.d�d/d�d0d1�d2d�d3d�d4d�d5d�d6d�d7d�d8d�d9d�d:d�d;d�d<d�d=d�d>d�d?d��Z6efe)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)e)d@�dfdO�Z	e7ej8e	��j9��Z:e:�;dL��GdP�dQej.��Z<efddR�dgdS�Z=ej0deiej1��GdT�dU����Z>ej?dV��Z@ejAeddddd1dW�dhdZ���ZBejAdid\���ZBdjd_�ZC	dkddddded`�dldd�ZBdS)mzDefining fields on models.�)�annotationsN)�copy)�Field)�cached_property)�Any�ClassVar)�warn)�PydanticUndefined)�Literal�Unpack�)�types)�_decorators�_fields�	_generics�_internal_dataclass�_repr�
_typing_extra�_utils)�PydanticUserError)�PydanticDeprecatedSince20)�ReprArgsr�_Unsetc�@�eZdZUdZded<ded<ded<ded	<d
ed<ded<ded
<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<d ed!<ded"<d#ed$<ded%<ded&<d'ed(<ded)<ded*<d+S),�_FromFieldInfoInputsz[This class exists solely to add type checking for the `**kwargs` in `FieldInfo.from_field`.�type[Any] | None�
annotation�typing.Callable[[], Any] | None�default_factory�
str | None�alias�
int | None�alias_priority�%str | AliasPath | AliasChoices | None�validation_alias�serialization_alias�title�description�list[Any] | None�examples�bool | None�exclude�float | None�gt�ge�lt�le�multiple_of�strict�
min_length�
max_length�pattern�
allow_inf_nan�
max_digits�decimal_placesz(Literal['smart', 'left_to_right'] | None�
union_mode�
discriminator�?dict[str, Any] | typing.Callable[[dict[str, Any]], None] | None�json_schema_extra�frozen�validate_default�bool�repr�init_var�kw_onlyN��__name__�
__module__�__qualname__�__doc__�__annotations__���D/opt/cloudlinux/venv/lib/python3.11/site-packages/pydantic/fields.pyrr(s}�������e�e� � � � �4�4�4�4���������;�;�;�;�#�#�#�#�����������������������������������������������������������������8�8�8�8�����V�V�V�V�����!�!�!�!��J�J�J����������rKrF)�totalc��eZdZUdZded<dS)�_FieldInfoInputszYThis class exists solely to add type checking for the `**kwargs` in `FieldInfo.__init__`.r�defaultNrDrJrKrLrOrOKs�������c�c��L�L�L�L�LrKrOc�2�eZdZUdZded<ded<ded<ded	<d
ed<ded
<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<d Zejej	ej
ejejej
ejejd!d!d!d!d!d"�
Zd#ed$<dGd)�ZeefdHd,���ZedId.���ZedJd/���ZedKd2���ZedLd5���ZedMd7���ZedNd9���Zd:d;�dOd=�ZdPd>�ZdQd?�ZdRdD�ZdSdF�Z d!S)T�	FieldInfoavThis class holds information about a field.

    `FieldInfo` is used for any field definition regardless of whether the [`Field()`][pydantic.fields.Field]
    function is explicitly used.

    !!! warning
        You generally shouldn't be creating `FieldInfo` directly, you'll only need to use it when accessing
        [`BaseModel`][pydantic.main.BaseModel] `.model_fields` internals.

    Attributes:
        annotation: The type annotation of the field.
        default: The default value of the field.
        default_factory: The factory function used to construct the default for the field.
        alias: The alias name of the field.
        alias_priority: The priority of the field's alias.
        validation_alias: The validation alias name of the field.
        serialization_alias: The serialization alias name of the field.
        title: The title of the field.
        description: The description of the field.
        examples: List of examples of the field.
        exclude: Whether to exclude the field from the model serialization.
        discriminator: Field name for discriminating the type in a tagged union.
        json_schema_extra: Dictionary of extra JSON schema properties.
        frozen: Whether the field is frozen.
        validate_default: Whether to validate the default value of the field.
        repr: Whether to include the field in representation of the model.
        init_var: Whether the field should be included in the constructor of the dataclass.
        kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.
        metadata: List of metadata constraints.
    rrrrPrrr r!r"r#r$r%r&r'r(r)r*r+r,r;r<r=r>r?r@rArBrC�	list[Any]�metadata)rrPrr!r#r%r&r'r(r*r,r;r=r>r?rArBrCrT�_attributes_setN)
r3r.r/r0r1r2r4r5r6r7r8r9r:z7ClassVar[dict[str, typing.Callable[[Any], Any] | None]]�metadata_lookup�kwargs�Unpack[_FieldInfoInputs]�return�Nonec��d�|���D��|_d�|���D��}|�|�d����\|_}|�dt��}|tur
t|_n||_|�dd��|_	|jtur|j	�td���|�dd��|_|�d	d��|_|�d
d��|_
|�dd��|_td�|j|j
|jfD����}|r|�d
d��pdnd|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�|��|z|_dS)aThis class should generally not be initialized directly; instead, use the `pydantic.fields.Field` function
        or one of the constructor classmethods.

        See the signature of `pydantic.fields.Field` for more details about the expected arguments.
        c�,�i|]\}}|tu�||��SrJ)r��.0�k�vs   rL�
<dictcomp>z&FieldInfo.__init__.<locals>.<dictcomp>�s#��S�S�S���A�1�F�?�?��1�?�?�?rKc�`�i|]+\}}||turt�|��n|��,SrJ)r�_DefaultValues�getr]s   rLraz&FieldInfo.__init__.<locals>.<dictcomp>�s9��\�\�\�T�Q��!�a�6�k�k�^�'�'��*�*�*�q�\�\�\rKrrPrN�/cannot specify both default and default_factoryr'r!r%r&c3�K�|]}|duV��	dS�NrJ)r^r!s  rL�	<genexpr>z%FieldInfo.__init__.<locals>.<genexpr>�s'����x�x��5��,�x�x�x�x�x�xrKr#�r(r*r,r;rATr=r?r>rBrC)�itemsrU�_extract_metadatardr�popr
�EllipsisrPr�	TypeErrorr'r!r%r&�anyr#r(r*r,r;rAr=r?r>rBrC�_collect_metadatarT)�selfrW�annotation_metadatarP�alias_is_sets     rL�__init__zFieldInfo.__init__�sq�� T�S������S�S�S���\�\�V�\�\�^�^�\�\�\��/3�/E�/E�f�j�j�Q]�F^�F^�/_�/_�,���,��*�*�Y�(9�:�:���h���,�D�L�L�"�D�L�%�z�z�*;�T�B�B����<�0�0�0�T�5I�5U��M�N�N�N��Z�Z���.�.��
��Z�Z���.�.��
� &�
�
�+=�t� D� D���#)�:�:�.C�T�#J�#J�� ��x�x�4�:�t�G\�^b�^v�:w�x�x�x�x�x��IU�_�f�j�j�)9�4�@�@�E�A��[_���!�:�:�m�T�:�:����
�
�:�t�4�4��
��z�z�)�T�2�2���#�Z�Z���>�>����J�J�v�t�,�,��	�!'���,?��!F�!F��� &�
�
�+=�t� D� D����j�j��4�0�0����
�
�:�t�4�4��
��z�z�)�T�2�2����.�.�v�6�6�9L�L��
�
�
rK�Unpack[_FromFieldInfoInputs]�typing_extensions.Selfc�<�d|vrtd���|dd|i|��S)a~Create a new `FieldInfo` object with the `Field` function.

        Args:
            default: The default value for the field. Defaults to Undefined.
            **kwargs: Additional arguments dictionary.

        Raises:
            TypeError: If 'annotation' is passed as a keyword argument.

        Returns:
            A new FieldInfo object with the given parameters.

        Example:
            This is how you can create a field with default value like this:

            ```python
            import pydantic

            class MyModel(pydantic.BaseModel):
                foo: int = pydantic.Field(4)
            ```
        rz9"annotation" is not permitted as a Field keyword argumentrPrJ)rn)�clsrPrWs   rL�
from_fieldzFieldInfo.from_field�s9��4�6�!�!��W�X�X�X��s�-�-�7�-�f�-�-�-rK�	type[Any]c�H�d}tj|��r*d}|tjurtj|��d}tj|��r�tj|��^}}tj|��rd}d�|D��}|j|d|i�}|ryt|��}||_|p|j	|_	g}|D]G}	t|	t��s|�|	���-|�
|	j���H||_|S|||pd���S)a�Creates a `FieldInfo` instance from a bare annotation.

        Args:
            annotation: An annotation object.

        Returns:
            An instance of the field metadata.

        Example:
            This is how you can create a field from a bare annotation like this:

            ```python
            import pydantic

            class MyModel(pydantic.BaseModel):
                foo: int  # <-- like this
            ```

            We also account for the case where the annotation can be an instance of `Annotated` and where
            one of the (not first) arguments in `Annotated` are an instance of `FieldInfo`, e.g.:

            ```python
            import annotated_types
            from typing_extensions import Annotated

            import pydantic

            class MyModel(pydantic.BaseModel):
                foo: Annotated[int, annotated_types.Gt(42)]
                bar: Annotated[int, pydantic.Field(gt=42)]
            ```

        FTrc�<�g|]}t|t���|��SrJ��
isinstancerR�r^�as  rL�
<listcomp>z-FieldInfo.from_annotation.<locals>.<listcomp>"s'��%X�%X�%X�A�z�!�Y�?W�?W�%X�a�%X�%X�%XrKrN)rr>)r�is_finalvar�typing_extensions�Final�get_args�is_annotated�merge_field_infosrrr>r~rR�append�extendrT)
rxr�final�	first_arg�
extra_args�field_info_annotations�
field_info�new_field_inforTr�s
          rL�from_annotationzFieldInfo.from_annotation�sZ��F���$�Z�0�0�	G��E��!2�!8�8�8�.�7�
�C�C�A�F�
��%�j�1�1�	&�%6�%?�
�%K�%K�"�I�
��(��3�3�
���%X�%X��%X�%X�%X�"�.��.�0F�]�S\�]�]�J��
&�!%�j�!1�!1��,5��)�(-�(B��1B��%�&(��#�4�4�A�%�a��3�3�4� ����*�*�*�*� ����
�3�3�3�3�*2��'�%�%��s�j���$�?�?�?�?rKc����d}tj|��r*d}|tjurtj|��d}t|���r`��|��\|_}|xj|z
c_|j	g�fd�|D���|�Rd|ji�}|p|j
|_
|St|tj��r�d}|tj
ur)tjdkrt!d���d}t"}n#t|tj
��r	d}|j}��|��}��|��\|_}|xj|z
c_|j	g�fd�|D���|�Rd|ji�}|p|j
|_
||_t+|d	d
��|_|Stj|��r�tj|��^}}d�|D��}	�j	|	||d��}
g}|D]G}t|t0��s|�|���-|�|j���H||
_|
S�|||pd
�
��S)a�Create `FieldInfo` from an annotation with a default value.

        Args:
            annotation: The type annotation of the field.
            default: The default value of the field.

        Returns:
            A field object with the passed values.

        Example:
            ```python
            import annotated_types
            from typing_extensions import Annotated

            import pydantic

            class MyModel(pydantic.BaseModel):
                foo: int = 4  # <-- like this
                bar: Annotated[int, annotated_types.Gt(4)] = 4  # <-- or this
                spam: Annotated[int, pydantic.Field(gt=4)] = 4  # <-- or this
            ```
        FTrc�4��g|]}t|����|��SrJ�r~�r^�xrxs  �rLr�z6FieldInfo.from_annotated_attribute.<locals>.<listcomp>U�(���G�G�G��J�q�#�4F�4F�G�!�G�G�GrKr)��zBInitVar is not supported in Python 3.7 as type information is lostc�4��g|]}t|����|��SrJr�r�s  �rLr�z6FieldInfo.from_annotated_attribute.<locals>.<listcomp>hr�rKrCNc�<�g|]}t|t���|��SrJr}rs  rLr�z6FieldInfo.from_annotated_attribute.<locals>.<listcomp>ss'��Q�Q�Q�Q�
�1�i�8P�8P�Q�q�Q�Q�QrK)rrP)rrPr>)rr�r�r�r�r~rkrrTr�r>�dataclassesr�InitVar�sys�version_info�RuntimeErrorr�type�_from_dataclass_fieldrB�getattrrCr�rRr�r�)
rxrrPr�rrrB�pydantic_fieldr�r��field_infosr�rTr�s
`            rL�from_annotated_attributez"FieldInfo.from_annotated_attribute3s����0���$�Z�0�0�	G��E��!2�!8�8�8�.�7�
�C�C�A�F�
��g�s�#�#�-	U�69�6K�6K�J�6W�6W�3�G�� 3���� 3�3���/�g�/��G�G�G�G�0�G�G�G��IP����]d�]o���G�#�4�g�n�G�N��N�
���!2�
3�
3�%	U��H��[�0�0�0��#�f�,�,�&�'k�l�l�l��� �
�
��J��(;�<�<�
-���'�_�
� �6�6�w�?�?�N�=@�=R�=R�S]�=^�=^�:�N�%�':��#�#�':�:�#�#�=�^�=��G�G�G�G�0�G�G�G������*�4���N�
%*�$B�^�-B�N�!�&.�N�#�%,�W�i��%F�%F�N�"�!�!��)�*�5�5�
"�):�)C�J�)O�)O�&�	�J�Q�Q�*�Q�Q�Q��2�S�2�K�I�_f�g�g�g�
�&(��#�4�4�A�%�a��3�3�4� ����*�*�*�*� ����
�3�3�3�3�&.�
�#�!�!��3�*�g�e�m�t�T�T�T�TrKr��	overridesc��g}|D];}|�d�|jD����|�|���<t|��}t	|��dkr\t|d��}|j�|��|���D]\}}t|||���|Si}i}|D]M}|�|j��|jD])}t|t��s||t|��<�*�N|�|��tdi|��}t|�����|_|S)z�Merge `FieldInfo` instances keeping only explicitly set attributes.

        Later `FieldInfo` instances override earlier ones.

        Returns:
            FieldInfo: A merged FieldInfo instance.
        c3�DK�|]}t|t���|V��dSrgr})r^r�s  rLrhz.FieldInfo.merge_field_infos.<locals>.<genexpr>�s3����(d�(d�q�:�VW�Yb�Kc�Kc�(d��(d�(d�(d�(d�(d�(drKr
rrJ)r�rTr��tuple�lenrrU�updaterj�setattrr~rRr��list�values)	r�r��flattened_field_infosr�r_r`�
new_kwargsrTr�s	         rLr�zFieldInfo.merge_field_infos�s���24��%�	5�	5�J�!�(�(�(d�(d�J�4G�(d�(d�(d�d�d�d�!�(�(��4�4�4�4��1�2�2���{���q� � ��k�!�n�-�-�J��&�-�-�i�8�8�8�!���)�)�
*�
*���1��
�A�q�)�)�)�)���%'�
���%�	*�	*�J����j�8�9�9�9��(�
*�
*��!�!�Y�/�/�*�()�H�T�!�W�W�%��
*�	���)�$�$�$��,�,��,�,�
�"�8�?�?�#4�#4�5�5�
���rK�dc_field�DataclassField[Any]c���|j}|tjurt}|jtjurd}n|j}d�|j���D��}td|||jd�|��S)a]Return a new `FieldInfo` instance from a `dataclasses.Field` instance.

        Args:
            dc_field: The `dataclasses.Field` instance to convert.

        Returns:
            The corresponding `FieldInfo` instance.

        Raises:
            TypeError: If any of the `FieldInfo` kwargs does not match the `dataclass.Field` kwargs.
        Nc�,�i|]\}}|tv�||��SrJ)�_FIELD_ARG_NAMESr]s   rLraz3FieldInfo._from_dataclass_field.<locals>.<dictcomp>�s)��a�a�a�d�a��1�P`�K`�K`�Q��K`�K`�K`rK)rPrrArJ)	rPr��MISSINGr
rrTrjrrA)rxr�rPr�dc_field_metadatas     rLr�zFieldInfo._from_dataclass_field�s����"���k�)�)�)�'�G��#�{�':�:�:�?C�O�O�&�6�O�b�a�h�.?�.E�.E�.G�.G�a�a�a���o�W�o�H�M�o�o�]n�o�o�orK�"tuple[type[Any] | None, list[Any]]c��|�;tj|��r'tj|��^}}|t	|��fS|gfS)a/Tries to extract metadata/constraints from an annotation if it uses `Annotated`.

        Args:
            annotation: The type hint annotation for which metadata has to be extracted.

        Returns:
            A tuple containing the extracted metadata type and the list of extra arguments.
        )rr�r�r�r�)rxrr�r�s    rLrkzFieldInfo._extract_metadata�sO���!��)�*�5�5�
3�):�)C�J�)O�)O�&�	�J� �$�z�"2�"2�2�2��2�~�rK�dict[str, Any]c�<�g}i}t|�����D]O\}}	|j|}n#t$rY� wxYw||=|�&|�|||<�1|�||�����P|r$|�tjdi|����|S)a�Collect annotations from kwargs.

        The return type is actually `annotated_types.BaseMetadata | PydanticMetadata`,
        but it gets combined with `list[Any]` from `Annotated[T, ...]`, hence types.

        Args:
            kwargs: Keyword arguments passed to the function.

        Returns:
            A list of metadata objects - a combination of `annotated_types.BaseMetadata` and
                `PydanticMetadata`.
        NrJ)r�rjrV�KeyErrorr�r�PydanticGeneralMetadata)rxrWrT�general_metadata�key�value�markers       rLrpzFieldInfo._collect_metadata�s���!�����v�|�|�~�~�.�.�	3�	3�J�C��
��,�S�1�����
�
�
���
�����s��� ��>�,1�$�S�)�)��O�O�F�F�5�M�M�2�2�2���	Q��O�O�G�;�O�O�>N�O�O�P�P�P��s�
:�
A�AF)�call_default_factoryr�c�r�|j�tj|j��S|r|���SdS)aGet the default value.

        We expose an option for whether to call the default_factory (if present), as calling it may
        result in side effects that we want to avoid. However, there are times when it really should
        be called (namely, when instantiating a model via `model_construct`).

        Args:
            call_default_factory: Whether to call the default_factory or not. Defaults to `False`.

        Returns:
            The default value, calling the default factory if requested or `None` if not set.
        N�rr�smart_deepcopyrP)rqr�s  rL�get_defaultzFieldInfo.get_default�s?����'��(���6�6�6�
!�	��'�'�)�)�)��4rKc�0�|jtuo|jduS)z�Check if the argument is required.

        Returns:
            `True` if the argument is required, `False` otherwise.
        N)rPr
r�rqs rL�is_requiredzFieldInfo.is_requireds���|�0�0�Q�T�5I�T�5Q�QrKc�^�|js|jStj|jg|j�RS)aRebuilds the original annotation for use in function signatures.

        If metadata is present, it adds it to the original annotation using an
        `AnnotatedAlias`. Otherwise, it returns the original annotation as is.

        Returns:
            The rebuilt annotation.
        )rTrr��	Annotatedr�s rL�rebuild_annotationzFieldInfo.rebuild_annotation	s6���}�	R��?�"�%�.���/P�$�-�/P�/P�Q�QrK�typevars_map�dict[Any, Any] | None�types_namespace�dict[str, Any] | Nonec�p�tj|j|d��}tj||��|_dS)aZApply a `typevars_map` to the annotation.

        This method is used when analyzing parametrized generic types to replace typevars with their concrete types.

        This method applies the `typevars_map` to the annotation in place.

        Args:
            typevars_map: A dictionary mapping type variables to their concrete types.
            types_namespace (dict | None): A dictionary containing related types to the annotated type.

        See Also:
            pydantic._internal._generics.replace_types is used for replacing the typevars with
                their concrete types.
        N)r�eval_type_lenientrr�
replace_types)rqr�r�rs    rL�apply_typevars_mapzFieldInfo.apply_typevars_maps3��#�4�T�_�o�W[�\�\�
�#�1�*�l�K�K����rKrc#�<K�dtjtj|j����fV�d|���fV�|jD]�}|dkr�	|dkr�|dkr|js�|dkr
|jdur�.|dkr
|jdur�>|d	kr|j	|j
kr�U|d
kr|j|j
kr�l|dkr7|j�0dtjtj|j����fV���t||��}|�|tur||fV���dS)Nr�requiredrUrTrATr>Fr%r&r)r�	PlainRepr�display_as_typerr��	__slots__rTrAr>r%r!r&rr�r
)rq�sr�s   rL�
__repr_args__zFieldInfo.__repr_args__*so�����E�O�E�,A�$�/�,R�,R�S�S�S�S�S�S��$�*�*�,�,�,�,�,�,���	#�	#�A��%�%�%���L� � ���j��������f�����d�!2�!2���H�}�}����!5�!5���&�&�&�4�+@�D�J�+N�+N���)�)�)�d�.F�$�*�.T�.T���%�%�%�$�*>�*J�'����9N�t�Oc�9d�9d�)e�)e�e�e�e�e�e���a�(�(���$��6G�)G�)G��U�(�N�N�N��)	#�	#rK)rWrXrYrZ)rPrrWrurYrv)rrzrYrv)rrzrPrrYrv)r�rRr�rrYrR)r�r�rYrv)rrrYr�)rWr�rYrS)r�r@rYr)rYr@�rYr)r�r�r�r�rYrZ)rYr)!rErFrGrHrIr�r�Strict�annotated_types�Gt�Ge�Lt�Le�
MultipleOf�MinLen�MaxLenrVrt�classmethodr
ryr�r��staticmethodr�r�rkrpr�r�r�r�r�rJrKrLrRrRQs����������>!� � � ��L�L�L�4�4�4�4���������;�;�;�;�#�#�#�#���������������������V�V�V�V�����!�!�!�!��J�J�J��������������I�4�,�� �� �� �� �&�1�%�,�%�,������P�P�O����� 'M�'M�'M�'M�R�-�.�.�.�.��[�.�:�;@�;@�;@��[�;@�z�JU�JU�JU��[�JU�X�����\��B�p�p�p��[�p�2�����[�� �����[��>;@�������(R�R�R�R�
R�
R�
R�
R�L�L�L�L�$#�#�#�#�#�#rKrRc�.�eZdZUdZded<dd
�Zdd�Zd
S)�	AliasPathz�Usage docs: https://docs.pydantic.dev/2.4/concepts/fields#aliaspath-and-aliaschoices

    A data class used by `validation_alias` as a convenience to create aliases.

    Attributes:
        path: A list of string or integer aliases.
    zlist[int | str]�pathr��str�args�	str | intrYrZc�6�|gt|��z|_dSrg)r�r�)rqr�r�s   rLrtzAliasPath.__init__Qs���K�$�t�*�*�,��	�	�	rK�list[str | int]c��|jS)zvConverts arguments to a list of string or integer aliases.

        Returns:
            The list of aliases.
        )r�r�s rL�convert_to_aliaseszAliasPath.convert_to_aliasesTs���y�rKN)r�r�r�r�rYrZ)rYr��rErFrGrHrIrtr�rJrKrLr�r�EsV�������������-�-�-�-������rKr�c�.�eZdZUdZded<dd�Zd
d
�ZdS)�AliasChoicesz�Usage docs: https://docs.pydantic.dev/2.4/concepts/fields#aliaspath-and-aliaschoices

    A data class used by `validation_alias` as a convenience to create aliases.

    Attributes:
        choices: A list containing a string or `AliasPath`.
    zlist[str | AliasPath]�choices�first_choice�str | AliasPathrYrZc�6�|gt|��z|_dSrg)r�r�)rqr�r�s   rLrtzAliasChoices.__init__is��$�~��W�
�
�5����rK�list[list[str | int]]c���g}|jD]U}t|t��r(|�|������?|�|g���V|S)z�Converts arguments to a list of lists containing string or integer aliases.

        Returns:
            The list of aliases.
        )r�r~r�r�r�)rq�aliases�cs   rLr�zAliasChoices.convert_to_aliaseslsi��*,����	$�	$�A��!�Y�'�'�
$����q�3�3�5�5�6�6�6�6�����s�#�#�#�#��rKN)r�r�r�r�rYrZ)rYr�r�rJrKrLr�r�]sV���������#�"�"�"�6�6�6�6������rKr�c��eZdZdZdS)�_EmptyKwargsz_This class exists solely to ensure that type checking warns about passing `**extra` in `Field`.N)rErFrGrHrJrKrLr�r�{s������i�i�i�irKr�rP.rr!r#r%r&r'r(r*r,r;r=r>r?rATrBrCr6r3r.r/r0r1r2r7r8r9r4r5)rr!r#r%r&r'r(r*r,r;r=r>r?rArBrCr6r3r.r/r0r1r2r7r8r9r4r5r:rr r"r$r)r+r<r@r-r:�!Literal['smart', 'left_to_right']�extra�Unpack[_EmptyKwargs]rYc���|�dd��}|�tdd����|�dd��} | �"tdt��|dtfvr| }|�dd��}!|!�"td	t��|dtfvr|!}|�d
d��}"|"�tdd����|�dd��}#|#�td
t��|#durd}|�dd��}$|$�tdd����|rUtdd�d�|���D�����d�t��|r	|tur|}|r:|tur1t|tttf��std���|tdfvrt|t��r|}|tdfvr|}|�dd��}%|%�tdt��tj
|fid|�d|�d|�d|�d|�d|�d|�d |�d!|	�d"|
�d#|�d$|�d%|�d&|
�d'|�d(|�d)|�d*|�d+|�d,|�d-|�d.|�d/|�d0|�d1|�d2|�d3|�d4|�d5|��S)6a]Usage docs: https://docs.pydantic.dev/2.4/concepts/fields

    Create a field for objects that can be configured.

    Used to provide extra information about a field, either for the model schema or complex validation. Some arguments
    apply only to number fields (`int`, `float`, `Decimal`) and some apply only to `str`.

    Note:
        - Any `_Unset` objects will be replaced by the corresponding value defined in the `_DefaultValues` dictionary. If a key for the `_Unset` object is not found in the `_DefaultValues` dictionary, it will default to `None`

    Args:
        default: Default value if the field is not set.
        default_factory: A callable to generate the default value, such as :func:`~datetime.utcnow`.
        alias: An alternative name for the attribute.
        alias_priority: Priority of the alias. This affects whether an alias generator is used.
        validation_alias: 'Whitelist' validation step. The field will be the single one allowed by the alias or set of
            aliases defined.
        serialization_alias: 'Blacklist' validation step. The vanilla field will be the single one of the alias' or set
            of aliases' fields and all the other fields will be ignored at serialization time.
        title: Human-readable title.
        description: Human-readable description.
        examples: Example values for this field.
        exclude: Whether to exclude the field from the model serialization.
        discriminator: Field name for discriminating the type in a tagged union.
        json_schema_extra: Any additional JSON schema data for the schema property.
        frozen: Whether the field is frozen.
        validate_default: Run validation that isn't only checking existence of defaults. This can be set to `True` or `False`. If not set, it defaults to `None`.
        repr: A boolean indicating whether to include the field in the `__repr__` output.
        init_var: Whether the field should be included in the constructor of the dataclass.
        kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.
        strict: If `True`, strict validation is applied to the field.
            See [Strict Mode](../concepts/strict_mode.md) for details.
        gt: Greater than. If set, value must be greater than this. Only applicable to numbers.
        ge: Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers.
        lt: Less than. If set, value must be less than this. Only applicable to numbers.
        le: Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers.
        multiple_of: Value must be a multiple of this. Only applicable to numbers.
        min_length: Minimum length for strings.
        max_length: Maximum length for strings.
        pattern: Pattern for strings.
        allow_inf_nan: Allow `inf`, `-inf`, `nan`. Only applicable to numbers.
        max_digits: Maximum number of allow digits for strings.
        decimal_places: Maximum number of decimal places allowed for numbers.
        union_mode: The strategy to apply when validating a union. Can be `smart` (the default), or `left_to_right`.
            See [Union Mode](standard_library_types.md#union-mode) for details.
        extra: Include extra fields used by the JSON schema.

            !!! warning Deprecated
                The `extra` kwargs is deprecated. Use `json_schema_extra` instead.

    Returns:
        A new [`FieldInfo`][pydantic.fields.FieldInfo], the return annotation is `Any` so `Field` can be used on
            type annotated fields without causing a typing error.
    �constNz)`const` is removed, use `Literal` insteadzremoved-kwargs)�code�	min_itemszG`min_items` is deprecated and will be removed, use `min_length` instead�	max_itemszG`max_items` is deprecated and will be removed, use `max_length` instead�unique_itemsz`unique_items` is removed, use `Set` instead(this feature is discussed in https://github.com/pydantic/pydantic-core/issues/296)�allow_mutationzH`allow_mutation` is deprecated and will be removed. use `frozen` insteadFT�regexz)`regex` is removed. use `pattern` insteadzzUsing extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead. (Extra keys: z, c3�>K�|]}|���V��dSrg)�__repr__)r^r_s  rLrhzField.<locals>.<genexpr>!s*����&J�&J��q�z�z�|�|�&J�&J�&J�&J�&J�&JrK�)zSInvalid `validation_alias` type. it should be `str`, `AliasChoices`, or `AliasPath`�includezS`include` is deprecated and does nothing. It will be removed, use `exclude` insteadrr!r#r%r&r'r(r*r,r;r=r>r6r?rArBrCr3r.r/r0r1r2r4r5r7r8r9r:)rlrr	�DeprecationWarningr�join�keysr~r�r�r�rnrRry)&rPrr!r#r%r&r'r(r*r,r;r=r>r?rArBrCr6r3r.r/r0r1r2r7r8r9r4r5r:rrrrrrr	r
s&                                      rLrr�s���r
�I�I�g�t�$�$�E���� K�Rb�c�c�c�c��	�	�+�t�,�,�I����
V�Xj�k�k�k��$���'�'�"�J��	�	�+�t�,�,�I����
V�Xj�k�k�k��$���'�'�"�J��9�9�^�T�2�2�L����f�"�
�
�
�	
��Y�Y�/��6�6�N��!��
W�Yk�l�l�l��U�"�"��F��I�I�g�t�$�$�E���� K�Rb�c�c�c�c��&��
N�!�Y�Y�&J�&J�U�Z�Z�\�\�&J�&J�&J�J�J�
N�
N�
N�
�		
�	
�	
�!�	&�$5��$?�$?� %��	�o��F�*�*��+�c�<��-K�L�L�
+��m�n�n�n��v�t�n�,�,��E�3�1G�1G�,�#���F�D�>�)�)� ���i�i�	�4�(�(�G����
b�dv�w�w�w�������'����e��&�~�	�
*�)��0�/�
��e�� �K��������$�m��,�+���v�����*�)�� �T�!�"��#�$��%�&�v�'�(�2�)�*�2�+�,�2�-�.�2�/�0 �K�1�2�:�3�4�:�5�6$�m�7�8�:�9�:&�~�;�<�:�=�rKc�V�eZdZdZdZefdd�dd�Zejsdd�Z	dd�Z
dd�Zdd�ZdS)�ModelPrivateAttraA descriptor for private attributes in class models.

    Attributes:
        default: The default value of the attribute if not provided.
        default_factory: A callable function that generates the default value of the
            attribute if not provided.
    �rPrN�rrPrrrrYrZc�"�||_||_dSrgr)rqrPrs   rLrtzModelPrivateAttr.__init__is�����.����rK�itemr�c��|dvr*t|j|��rt|j|��Stt	|��j�d|�����)z�This function improves compatibility with custom descriptors by ensuring delegation happens
            as expected when the default value of a private attribute is a descriptor.
            >�__get__�__set__�
__delete__z object has no attribute )�hasattrrPr��AttributeErrorr�rE)rqrs  rL�__getattr__zModelPrivateAttr.__getattr__rs\���;�;�;��4�<��.�.�7�"�4�<��6�6�6� �D��J�J�$7�!\�!\�TX�!\�!\�]�]�]rKrxrz�namec��|jturdSt|jd��sdS|jj}t	|��r|||��dSdS)zMPreserve `__set_name__` protocol defined in https://peps.python.org/pep-0487.N�__set_name__)rPr
rr �callable)rqrxr�set_names    rLr zModelPrivateAttr.__set_name__{sj���<�,�,�,��F��t�|�^�4�4�	��F��<�,���H���	 ��H�S�$������	 �	 rKc�j�|j�tj|j��n|���S)aURetrieve the default value of the object.

        If `self.default_factory` is `None`, the method will return a deep copy of the `self.default` object.

        If `self.default_factory` is not `None`, it will call `self.default_factory` and return the value returned.

        Returns:
            The default value of the object.
        r�r�s rLr�zModelPrivateAttr.get_default�s1��7;�6J�6R�v�$�T�\�2�2�2�X\�Xl�Xl�Xn�Xn�nrK�otherr@c�h�t||j��o|j|jf|j|jfkSrg)r~�	__class__rPr)rqr$s  rL�__eq__zModelPrivateAttr.__eq__�s=���%���0�0�
�d�l�D�DX�5Y��M��!�^
�6
�	
rK)rPrrrrYrZ)rr�rYr)rxrzrr�rYrZr�)r$rrYr@)
rErFrGrHr�r
rt�typing�
TYPE_CHECKINGrr r�r'rJrKrLrr^s���������-�I�/�/�fj�/�/�/�/�/�/���
^�	^�	^�	^�	^� � � � �
o�
o�
o�
o�
�
�
�
�
�
rKrrc�X�|tur|�td���t||���S)a�Indicates that attribute is only used internally and never mixed with regular fields.

    Private attributes are not checked by Pydantic, so it's up to you to maintain their accuracy.

    Private attributes are stored in `__private_attributes__` on the model.

    Args:
        default: The attribute's default value. Defaults to Undefined.
        default_factory: Callable that will be
            called when a default value is needed for this attribute.
            If both `default` and `default_factory` are set, an error will be raised.

    Returns:
        An instance of [`ModelPrivateAttr`][pydantic.fields.ModelPrivateAttr] class.

    Raises:
        ValueError: If both `default` and `default_factory` are set.
    Nrer)r
rnrrs  rL�PrivateAttrr+�sA��.�'�'�'�O�,G��I�J�J�J���'����rKc�h�eZdZUdZdZded<ded<ded<d	ed
<ded<d	ed
<d	ed<ded<dS)�ComputedFieldInfoa+A container for data from `@computed_field` so that we can access it while building the pydantic-core schema.

    Attributes:
        decorator_repr: A class variable representing the decorator string, '@computed_field'.
        wrapped_property: The wrapped computed field property.
        return_type: The type of the computed field property's return value.
        alias: The alias of the property to be used during encoding and decoding.
        alias_priority: priority of the alias. This affects whether an alias generator is used
        title: Title of the computed field as in OpenAPI document, should be a short summary.
        description: Description of the computed field as in OpenAPI document.
        repr: A boolean indicating whether or not to include the field in the __repr__ output.
    z@computed_fieldz
ClassVar[str]�decorator_repr�property�wrapped_propertyr�return_typer r!r"r#r'r(r@rAN)rErFrGrHr.rIrJrKrLr-r-�s~���������%6�N�5�5�5�5��������������������������J�J�J�J�JrKr-�	PropertyT�r1r!r#r'r(rAr1�'typing.Callable[[PropertyT], PropertyT]c��dSrgrJr3s      rL�computed_fieldr6�s	���CrK�__funcc��dSrgrJ)r7s rLr6r6�s���CrK�	property_�cached_property | propertyc�
�d}t|t��rt|jdd��}n+t|t��rt|jdd��}|�d��o|�d��S)z>Returns true if provided property is private, False otherwise.�rE�_�__)r~r/r��fgetr�func�
startswith)r9�wrapped_names  rL�_wrapped_property_is_privaterC�s}���L��)�X�&�&�?��y�~�z�2�>�>���	�I��	/�	/�?��y�~�z�2�>�>���"�"�3�'�'�M��0G�0G��0M�0M�,M�MrK)r!r#r'r(rAr1�__f�PropertyT | None�3PropertyT | typing.Callable[[PropertyT], PropertyT]c�B�������d������fd�}|�|S||��S)a�Decorator to include `property` and `cached_property` when serializing models or dataclasses.

    This is useful for fields that are computed from other fields, or for fields that are expensive to compute and should be cached.

    ```py
    from pydantic import BaseModel, computed_field

    class Rectangle(BaseModel):
        width: int
        length: int

        @computed_field
        @property
        def area(self) -> int:
            return self.width * self.length

    print(Rectangle(width=3, length=2).model_dump())
    #> {'width': 3, 'length': 2, 'area': 6}
    ```

    If applied to functions not yet decorated with `@property` or `@cached_property`, the function is
    automatically wrapped with `property`. Although this is more concise, you will lose IntelliSense in your IDE,
    and confuse static type checkers, thus explicit use of `@property` is recommended.

    !!! warning "Mypy Warning"
        Even with the `@property` or `@cached_property` applied to your function before `@computed_field`,
        mypy may throw a `Decorated property not supported` error.
        See [mypy issue #1362](https://github.com/python/mypy/issues/1362), for more information.
        To avoid this error message, add `# type: ignore[misc]` to the `@computed_field` line.

        [pyright](https://github.com/microsoft/pyright) supports `@computed_field` without error.

    ```py
    import random

    from pydantic import BaseModel, computed_field

    class Square(BaseModel):
        width: float

        @computed_field
        def area(self) -> float:  # converted to a `property` by `computed_field`
            return round(self.width**2, 2)

        @area.setter
        def area(self, new_area: float) -> None:
            self.width = new_area**0.5

        @computed_field(alias='the magic number', repr=False)
        def random_number(self) -> int:
            return random.randint(0, 1_000)

    square = Square(width=1.3)

    # `random_number` does not appear in representation
    print(repr(square))
    #> Square(width=1.3, area=1.69)

    print(square.random_number)
    #> 3

    square.area = 4

    print(square.model_dump_json(by_alias=True))
    #> {"width":2.0,"area":4.0,"the magic number":3}
    ```

    !!! warning "Overriding with `computed_field`"
        You can't override a field from a parent class with a `computed_field` in the child class.
        `mypy` complains about this behavior if allowed, and `dataclasses` doesn't allow this pattern either.
        See the example below:

    ```py
    from pydantic import BaseModel, computed_field

    class Parent(BaseModel):
        a: str

    try:

        class Child(Parent):
            @computed_field
            @property
            def a(self) -> str:
                return 'new a'

    except ValueError as e:
        print(repr(e))
        #> ValueError("you can't override a field with a computed field")
    ```

    Private properties decorated with `@computed_field` have `repr=False` by default.

    ```py
    from functools import cached_property

    from pydantic import BaseModel, computed_field

    class Model(BaseModel):
        foo: int

        @computed_field
        @cached_property
        def _private_cached_property(self) -> int:
            return -self.foo

        @computed_field
        @property
        def _private_property(self) -> int:
            return -self.foo

    m = Model(foo=1)
    print(repr(m))
    #> M(foo=1)
    ```

    Args:
        __f: the function to wrap.
        alias: alias to use when serializing this computed field, only used when `by_alias=True`
        alias_priority: priority of the alias. This affects whether an alias generator is used
        title: Title to used when including this computed field in JSON Schema, currently unused waiting for #4697
        description: Description to used when including this computed field in JSON Schema, defaults to the functions
            docstring, currently unused waiting for #4697
        repr: whether to include this computed field in model repr.
            Default is `False` for private properties and `True` for public properties.
        return_type: optional return for serialization logic to expect when serializing to JSON, if included
            this must be correct, otherwise a `TypeError` is raised.
            If you don't include a return type Any is used, which does runtime introspection to handle arbitrary
            objects.

    Returns:
        A proxy wrapper for the property.
    �frrYc	�.��tj|��}�� |jrtj|j���tj|��}���pdnd���t
|���rdnd}n�}t|����	�|��}tj||��S)Nri)r9FT)	r�unwrap_wrapped_functionrH�inspect�cleandoc�ensure_propertyrCr-�PydanticDescriptorProxy)
rH�	unwrapped�repr_�dec_infor!r#r(rAr1r's
    ������rL�deczcomputed_field.<locals>.dec�s�����7��:�:�	���9�#4��!�*�9�+<�=�=�K�
�'��*�*��27�2C�.�-�A�����<�#?�!�#L�#L�#L�V�%�%�RV�E�E��E�$�Q��U�N�E�S^�`e�f�f���2�1�h�?�?�?rKN)rHrrYrrJ)rDr!r#r'r(rAr1rRs `````` rLr6r6�sd��������`@�@�@�@�@�@�@�@�@�@�@�$�{��
��s�3�x�x�rKrJ)@rPrrrr!r r#r"r%r$r&r r'r r(r r*r)r,r+r;r r=r<r>r+r?r+rAr@rBr+rCr+r6r r3r+r.r-r/r-r0r-r1r-r2r-r7r+r8r"r9r"r4r"r5r"r:r�rrrYr)rPrrrrYr)r1rr!r r#r"r'r r(r rAr@rYr4)r7r2rYr2)r9r:rYr@rg)rDrEr!r r#r"r'r r(r rAr+r1rrYrF)DrH�
__future__r�_annotationsr�rKr�r(rr�DataclassField�	functoolsr�ImportErrorrr�warningsr	r�r��
pydantic_corer
rrr<r�	_internalrrrrrrr�errorsrrr)�_internal._reprrrrrI�	TypedDictrrO�RepresentationrR�	dataclass�
slots_truer�r�r��dictrc�set�	signature�
parametersr��removerr+r-�TypeVarr2�overloadr6rCrJrKrL�<module>rhs��� � � �2�2�2�2�2�2���������
�
�
�
�
�
�
�
�������/�/�/�/�/�/��)�)�)�)�)�)�)�������O�O�O�����!� � � � � � � ���������������+�+�+�+�+�+�-�-�-�-�-�-�-�-�������i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�%�%�%�%�%�%�/�/�/�/�/�/�	��3�)�)�)�)�)�)�)�3�� ������ � � � � �,�6�e� � � � �F�����+�5�����q#�q#�q#�q#�q#��$�q#�q#�q#�h���8�8�,�7�8�8��������9�8��.���8�8�,�7�8�8��������9�8��:j�j�j�j�j�$�.�j�j�j�������C���D���$���4�	�
�T����
��$������T��
�D���$���d���4���T��
��� �T�!�"
�D�#�$
�D�%�&�4�'�(�t�)�*�t�+�,�t�-�.�t�/�0��1�2�$�3�4�t�5�6�4�7�8�t�9�:�t�;��D%�w�8>��!'�>D�&,��$�!'�!� &�Y_� �$*��"�!� � ����� &�!'�#�!'�#�#�4:�?w�w�w�w�w�w�t�3�(�w�(��/�/�:�;�;������ � � �7
�7
�7
�7
�7
�u�+�7
�7
�7
�v%��8<�������@���8�8�,�7�8�8��������9�8��4
�F�N�;�'�'�	���)��!%��"��	�	�	�	�	���	���������	N�	N�	N�	N�!�e��!%��"��(�e�e�e�e�e�e�e�es�.�8�8