+
    NV-jì{  ã                  óø  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtHtHtHtHtHtHtHtHt ^ RIHtHt ^ RIHtHt ^RIHtHtHt ^RIHt ^R	I H!t! ^R
I"H#t# ^RIH$t$H%t% ]PL                  RS8  d   ^ RIH't' M^ RI
H't' ]PP                  t)]PT                  ! RTRR/]PV                  B  ! R R4      4       t,]PT                  ! RTRR/]PV                  B  ! R R4      4       t-]PT                  ! RTRR/]PV                  B  ! R R4      4       t.]PT                  ! RTRR/]PV                  B  ! R R4      4       t/]'       dÀ    ! R R]'4      t0 ! R R]'4      t1 ! R R]'4      t2 ! R R]'4      t3]]1]Ph                  ]0]Pj                  3,          t6]]3]Pn                  ]2]Pp                  3,          t9]]:]]]3,          ];]]3,          ]	],          3,          t<R]=R &   ]! R!]]6]<3,          R"7      t>]! R#]]9]<3,          R"7      t?]RU,          t@R]=R%&   ]R&R'R(R'/R) R* ll4       tA]R&R'R(R'/R+ R, ll4       tA]R-R'R&R'/R. R/ ll4       tAR-R$R&RR(]/R0 R1 lltA]! R24      tB]! R3RR47      tC ! R5 R6]Pˆ                  ]']C,          4      tE ! R7 R8]']B,          4      tF ! R9 R:]']B,          4      tG ! R; R<]'4      tH ! R= R>]'4      tI ! R? R@]'4      tJ ! RA RB]'4      tK]]B.]B3,          tL ]]B]Pš                  ],          .]B3,          tN ]]G]B,          ]F]B,          3,          tO]]J]K]H]I3,          tP]]N]B,          ]L]B,          3,          tQ]RC RD l4       tR]RE RF l4       tR]RG RH l4       tRRI RJ ltR]! RK4      tS]'       d   ]]SR'3,          tTM)]PT                  ! RT/ ]PV                  B  ! RL RM4      4       tT]'       d   ]]SR'3,          tUM)]PT                  ! RT/ ]PV                  B  ! RN RO4      4       tU]! RP4      tV ! RQ RR4      tWR# )VzBThis module contains related classes and functions for validation.)ÚannotationsN)Úpartialmethod)	ÚTYPE_CHECKINGÚ	AnnotatedÚAnyÚCallableÚLiteralÚTypeVarÚUnionÚcastÚoverload)ÚPydanticUndefinedÚcore_schema)ÚSelfÚ	TypeAlias)Ú_decoratorsÚ	_genericsÚ_internal_dataclass)ÚGetCoreSchemaHandler)ÚPydanticUserError)Úversion_short)ÚArbitraryTypeWarningÚPydanticDeprecatedSince212)ÚProtocolÚfrozenTc                  óH   € ] tR t^t$ RtR]R&   R R lt]R R l4       tRt	R	# )
ÚAfterValidatoraÔ  !!! abstract "Usage Documentation"
    [field *after* validators](../concepts/validators.md#field-after-validator)

A metadata class that indicates that a validation should be applied **after** the inner validation logic.

Attributes:
    func: The validator function.

Example:
    ```python
    from typing import Annotated

    from pydantic import AfterValidator, BaseModel, ValidationError

    MyInt = Annotated[int, AfterValidator(lambda v: v + 1)]

    class Model(BaseModel):
        a: MyInt

    print(Model(a=1).a)
    #> 2

    try:
        Model(a='a')
    except ValidationError as e:
        print(e.json(indent=2))
        '''
        [
          {
            "type": "int_parsing",
            "loc": [
              "a"
            ],
            "msg": "Input should be a valid integer, unable to parse string as an integer",
            "input": "a",
            "url": "https://errors.pydantic.dev/2/v/int_parsing"
          }
        ]
        '''
    ```
úKcore_schema.NoInfoValidatorFunction | core_schema.WithInfoValidatorFunctionÚfuncc               ó$   € V ^8„  d   QhRRRRRR/# ©é   Úsource_typer   Úhandlerr   Úreturnúcore_schema.CoreSchema© )Úformats   "Úo/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/pydantic/functional_validators.pyÚ__annotate__ÚAfterValidator.__annotate__J   s(   € ÷ Uñ U¸ð UÐFZð UÐ_uñ Uó    c                	ó>  € V! V4      p\        V P                  R RR7      pV'       d<   \        \        P                  V P                  4      p\        P
                  ! WSR7      # \        \        P                  V P                  4      p\        P                  ! WSR7      # )ÚafterÚfield©ÚmodeÚtype©Úschema)Ú_inspect_validatorr   r   r   ÚWithInfoValidatorFunctionÚ"with_info_after_validator_functionÚNoInfoValidatorFunctionÚ no_info_after_validator_function)Úselfr"   r#   r3   Úinfo_argr   s   &&&   r(   Ú__get_pydantic_core_schema__Ú+AfterValidator.__get_pydantic_core_schema__J   so   € Ù˜Ó%ˆÜ% d§i¡i°gÀGÔLˆßÜœ×=Ñ=¸t¿y¹yÓIˆDÜ×AÒAÀ$ÔVÐVäœ×;Ñ;¸T¿Y¹YÓGˆDÜ×?Ò?ÀÔTÐTr+   c               ó    € V ^8„  d   QhRRRR/# ©r!   Ú	decoratorz>_decorators.Decorator[_decorators.FieldValidatorDecoratorInfo]r$   r   r&   )r'   s   "r(   r)   r*   U   s   € ÷ (ñ (Ð(fð (Ðkoñ (r+   c                	ó(   € V ! VP                   R 7      # )©r   rA   ©Úclsr?   s   &&r(   Ú_from_decoratorÚAfterValidator._from_decoratorT   s   € á˜	Ÿ™Ô'Ð'r+   r&   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r;   ÚclassmethodrD   Ú__static_attributes__r&   r+   r(   r   r      s+   ‡ ñ(ðT VÓUõUð ô(ó ô(r+   r   c                  óV   € ] tR t^Yt$ RtR]R&   ]tR]R&   R R lt]	R R	 l4       t
R
tR# )ÚBeforeValidatora,  !!! abstract "Usage Documentation"
    [field *before* validators](../concepts/validators.md#field-before-validator)

A metadata class that indicates that a validation should be applied **before** the inner validation logic.

Attributes:
    func: The validator function.
    json_schema_input_type: The input type used to generate the appropriate
        JSON Schema (in validation mode). The actual input type is `Any`.

Example:
    ```python
    from typing import Annotated

    from pydantic import BaseModel, BeforeValidator

    MyInt = Annotated[int, BeforeValidator(lambda v: v + 1)]

    class Model(BaseModel):
        a: MyInt

    print(Model(a=1).a)
    #> 2

    try:
        Model(a='a')
    except TypeError as e:
        print(e)
        #> can only concatenate str (not "int") to str
    ```
r   r   r   Újson_schema_input_typec               ó$   € V ^8„  d   QhRRRRRR/# r    r&   )r'   s   "r(   r)   ÚBeforeValidator.__annotate__~   s#   € ÷ ñ ¸ð ÐFZð Ð_uñ r+   c                	ó¦  € V! V4      pV P                   \        J d   R MVP                  V P                   4      p\        V P                  RRR7      pV'       d>   \        \        P                  V P                  4      p\        P                  ! VVVR7      # \        \        P                  V P                  4      p\        P                  ! WcVR7      # )NÚbeforer.   r/   ©r3   Újson_schema_input_schema)rP   r   Úgenerate_schemar4   r   r   r   r5   Ú#with_info_before_validator_functionr7   Ú!no_info_before_validator_function©r9   r"   r#   r3   Úinput_schemar:   r   s   &&&    r(   r;   Ú,BeforeValidator.__get_pydantic_core_schema__~   s´   € Ù˜Ó%ˆð ×*Ñ*Ô.?Ó?ñ à×(Ñ(¨×)DÑ)DÓEð 	ô & d§i¡i°hÀWÔMˆßÜœ×=Ñ=¸t¿y¹yÓIˆDÜ×BÒBØØØ)5ôð ô œ×;Ñ;¸T¿Y¹YÓGˆDÜ×@Ò@Ø¸lôð r+   c               ó    € V ^8„  d   QhRRRR/# r>   r&   )r'   s   "r(   r)   rR   •   ó   € ÷ 
ñ 
Ð(fð 
Ðkoñ 
r+   c                	óR   € V ! VP                   VP                  P                  R 7      # ©)r   rP   ©r   ÚinforP   rB   s   &&r(   rD   ÚBeforeValidator._from_decorator”   ó#   € áØ—‘Ø#,§>¡>×#HÑ#Hô
ð 	
r+   r&   N©rF   rG   rH   rI   rJ   rK   r   rP   r;   rL   rD   rM   r&   r+   r(   rO   rO   Y   s5   ‡ ñð@ VÓUØ"3Ð˜CÓ3õð, ô
ó ô
r+   rO   c                  óV   € ] tR t^œt$ RtR]R&   ]tR]R&   R R lt]	R R	 l4       t
R
tR# )ÚPlainValidatora  !!! abstract "Usage Documentation"
    [field *plain* validators](../concepts/validators.md#field-plain-validator)

A metadata class that indicates that a validation should be applied **instead** of the inner validation logic.

!!! note
    Before v2.9, `PlainValidator` wasn't always compatible with JSON Schema generation for `mode='validation'`.
    You can now use the `json_schema_input_type` argument to specify the input type of the function
    to be used in the JSON schema when `mode='validation'` (the default). See the example below for more details.

Attributes:
    func: The validator function.
    json_schema_input_type: The input type used to generate the appropriate
        JSON Schema (in validation mode). The actual input type is `Any`.

Example:
    ```python
    from typing import Annotated, Union

    from pydantic import BaseModel, PlainValidator

    def validate(v: object) -> int:
        if not isinstance(v, (int, str)):
            raise ValueError(f'Expected int or str, got {type(v)}')

        return int(v) + 1

    MyInt = Annotated[
        int,
        PlainValidator(validate, json_schema_input_type=Union[str, int]),  # (1)!
    ]

    class Model(BaseModel):
        a: MyInt

    print(Model(a='1').a)
    #> 2

    print(Model(a=1).a)
    #> 2
    ```

    1. In this example, we've specified the `json_schema_input_type` as `Union[str, int]` which indicates to the JSON schema
    generator that in validation mode, the input type for the `a` field can be either a [`str`][] or an [`int`][].
r   r   r   rP   c               ó$   € V ^8„  d   QhRRRRRR/# r    r&   )r'   s   "r(   r)   ÚPlainValidator.__annotate__Ï   s#   € ÷ 'ñ '¸ð 'ÐFZð 'Ð_uñ 'r+   c           
     	ó  € ^ RI Hp  V! V4      pVP                  R\        P                  ! R VVP                  V4      R7      4      pVP                  V P                  4      p\        V P                  RRR7      pV'       d>   \        \        P                  V P                  4      p\        P                  ! VVVR	7      # \        \        P                  V P                  4      p\        P                  ! VVVR	7      #   T d    Rp LÀi ; i)
é    )ÚPydanticSchemaGenerationErrorÚserializationc                ó   € V! V 4      # ©Nr&   ©ÚvÚhs   &&r(   Ú<lambda>Ú=PlainValidator.__get_pydantic_core_schema__.<locals>.<lambda>Þ   ó   € ©!¨A¬$r+   )Úfunctionr3   Úreturn_schemaNÚplainr.   r/   )rm   rV   )Úpydanticrl   Úgetr   Ú#wrap_serializer_function_ser_schemarW   rP   r4   r   r   r5   Ú"with_info_plain_validator_functionr7   Ú no_info_plain_validator_function)	r9   r"   r#   rl   r3   rm   r[   r:   r   s	   &&&      r(   r;   Ú+PlainValidator.__get_pydantic_core_schema__Ï   sô   € õ 	;ð	!Ù˜[Ó)ˆFð #ŸJ™JØÜ×?Ò?Ù.Ø!Ø")×"9Ñ"9¸+Ó"FôóˆMð ×.Ñ.¨t×/JÑ/JÓKˆä% d§i¡i°gÀGÔLˆßÜœ×=Ñ=¸t¿y¹yÓIˆDÜ×AÒAØØ+Ø)5ôð ô œ×;Ñ;¸T¿Y¹YÓGˆDÜ×?Ò?ØØ+Ø)5ôð øð -ô 	!Ø ŠMð	!ús   ˆAC> Ã>	D
Ä	D
c               ó    € V ^8„  d   QhRRRR/# r>   r&   )r'   s   "r(   r)   ri   ù   r^   r+   c                	óR   € V ! VP                   VP                  P                  R 7      # r`   ra   rB   s   &&r(   rD   ÚPlainValidator._from_decoratorø   rd   r+   r&   N)rF   rG   rH   rI   rJ   rK   r   rP   r;   rL   rD   rM   r&   r+   r(   rg   rg   œ   s6   ‡ ñ,ð\ VÓUØ"%Ð˜CÓ%õ'ðR ô
ó ô
r+   rg   c                  óV   € ] tR tRt$ RtR]R&   ]tR]R&   R R lt]	R	 R
 l4       t
RtR# )ÚWrapValidatoré   ab  !!! abstract "Usage Documentation"
    [field *wrap* validators](../concepts/validators.md#field-wrap-validator)

A metadata class that indicates that a validation should be applied **around** the inner validation logic.

Attributes:
    func: The validator function.
    json_schema_input_type: The input type used to generate the appropriate
        JSON Schema (in validation mode). The actual input type is `Any`.

```python
from datetime import datetime
from typing import Annotated

from pydantic import BaseModel, ValidationError, WrapValidator

def validate_timestamp(v, handler):
    if v == 'now':
        # we don't want to bother with further validation, just return the new value
        return datetime.now()
    try:
        return handler(v)
    except ValidationError:
        # validation failed, in this case we want to return a default value
        return datetime(2000, 1, 1)

MyTimestamp = Annotated[datetime, WrapValidator(validate_timestamp)]

class Model(BaseModel):
    a: MyTimestamp

print(Model(a='now').a)
#> 2032-01-02 03:04:05.000006
print(Model(a='invalid').a)
#> 2000-01-01 00:00:00
```
zScore_schema.NoInfoWrapValidatorFunction | core_schema.WithInfoWrapValidatorFunctionr   r   rP   c               ó$   € V ^8„  d   QhRRRRRR/# r    r&   )r'   s   "r(   r)   ÚWrapValidator.__annotate__+  s#   € ÷ ñ ¸ð ÐFZð Ð_uñ r+   c                	ó¨  € V! V4      pV P                   \        J d   R MVP                  V P                   4      p\        V P                  RRR7      pV'       d>   \        \        P                  V P                  4      p\        P                  ! VVVR7      # \        \        P                  V P                  4      p\        P                  ! VVVR7      # )NÚwrapr.   r/   rU   )rP   r   rW   r4   r   r   r   ÚWithInfoWrapValidatorFunctionÚ!with_info_wrap_validator_functionÚNoInfoWrapValidatorFunctionÚno_info_wrap_validator_functionrZ   s   &&&    r(   r;   Ú*WrapValidator.__get_pydantic_core_schema__+  s¸   € Ù˜Ó%ˆð ×*Ñ*Ô.?Ó?ñ à×(Ñ(¨×)DÑ)DÓEð 	ô & d§i¡i°fÀ7ÔKˆßÜœ×AÑAÀ4Ç9Á9ÓMˆDÜ×@Ò@ØØØ)5ôð ô œ×?Ñ?ÀÇÁÓKˆDÜ×>Ò>ØØØ)5ôð r+   c               ó    € V ^8„  d   QhRRRR/# r>   r&   )r'   s   "r(   r)   r†   D  r^   r+   c                	óR   € V ! VP                   VP                  P                  R 7      # r`   ra   rB   s   &&r(   rD   ÚWrapValidator._from_decoratorC  rd   r+   r&   Nre   r&   r+   r(   rƒ   rƒ      s5   ‡ ñ$ðL ^Ó]Ø"3Ð˜CÓ3õð0 ô
ó ô
r+   rƒ   c                  ó"   € ] tR tRtR R ltRtR# )Ú_OnlyValueValidatorClsMethodiM  c               ó$   € V ^8„  d   QhRRRRRR/# ©r!   rC   r   Úvaluer$   r&   )r'   s   "r(   r)   Ú)_OnlyValueValidatorClsMethod.__annotate__N  s   € ×?Ñ? Ð?¨CÐ?°sÑ?r+   c               	ó   € R # ro   r&   ©r9   rC   r•   s   """r(   Ú__call__Ú%_OnlyValueValidatorClsMethod.__call__N  s   € ¹Cr+   r&   N©rF   rG   rH   rI   r™   rM   r&   r+   r(   r’   r’   M  s   † ß?Ñ?r+   r’   c                  ó"   € ] tR tRtR R ltRtR# )Ú_V2ValidatorClsMethodiP  c               ó(   € V ^8„  d   QhRRRRRRRR/# ©r!   rC   r   r•   rb   úcore_schema.ValidationInfo[Any]r$   r&   )r'   s   "r(   r)   Ú"_V2ValidatorClsMethod.__annotate__Q  s   € ×fÑf Ðf¨CÐfÐ7VÐfÐ^aÑfr+   c               	ó   € R # ro   r&   ©r9   rC   r•   rb   s   """"r(   r™   Ú_V2ValidatorClsMethod.__call__Q  s   € Ñcfr+   r&   Nr›   r&   r+   r(   r�   r�   P  s   † ßfÑfr+   r�   c                  ó"   € ] tR tRtR R ltRtR# )Ú _OnlyValueWrapValidatorClsMethodiS  c               ó(   € V ^8„  d   QhRRRRRRRR/# )r!   rC   r   r•   r#   ú(core_schema.ValidatorFunctionWrapHandlerr$   r&   )r'   s   "r(   r)   Ú-_OnlyValueWrapValidatorClsMethod.__annotate__T  s   € ×rÑr Ðr¨CÐrÐ:bÐrÐjmÑrr+   c               	ó   € R # ro   r&   ©r9   rC   r•   r#   s   """"r(   r™   Ú)_OnlyValueWrapValidatorClsMethod.__call__T  s   € Ñorr+   r&   Nr›   r&   r+   r(   r¦   r¦   S  s   † ßrÑrr+   r¦   c                  ó"   € ] tR tRtR R ltRtR# )Ú_V2WrapValidatorClsMethodiV  c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r!   rC   r   r•   r#   r¨   rb   r    r$   r&   )r'   s   "r(   r)   Ú&_V2WrapValidatorClsMethod.__annotate__W  s<   € ÷ 	ñ 	àð	ð ð	ð >ð		ð
 2ð	ð ñ	r+   c               	ó   € R # ro   r&   ©r9   rC   r•   r#   rb   s   """""r(   r™   Ú"_V2WrapValidatorClsMethod.__call__W  s   € ñ r+   r&   Nr›   r&   r+   r(   r®   r®   V  s   † ÷	ñ 	r+   r®   r   Ú_PartialClsOrStaticMethodÚ"_V2BeforeAfterOrPlainValidatorType)ÚboundÚ_V2WrapValidatorTyper-   ÚFieldValidatorModesÚcheck_fields.rP   c               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r!   r.   ÚstrÚfieldsr0   úLiteral['wrap']r¹   úbool | NonerP   r   r$   z6Callable[[_V2WrapValidatorType], _V2WrapValidatorType]r&   )r'   s   "r(   r)   r)   z  sN   € ÷ Añ AØðAð ðAð ð	Að
 ðAð  ðAð <ñAr+   c              ó   € R # ro   r&   ©r.   r0   r¹   rP   r¼   s   "$$$*r(   Úfield_validatorrÁ   y  s   € ñ >Ar+   c               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r!   r.   r»   r¼   r0   zLiteral['before', 'plain']r¹   r¾   rP   r   r$   úRCallable[[_V2BeforeAfterOrPlainValidatorType], _V2BeforeAfterOrPlainValidatorType]r&   )r'   s   "r(   r)   r)   …  sO   € ÷ ]ñ ]Øð]ð ð]ð %ð	]ð
 ð]ð  ð]ð Xñ]r+   c              ó   € R # ro   r&   rÀ   s   "$$$*r(   rÁ   rÁ   „  s	   € ñ Z]r+   r0   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r!   r.   r»   r¼   r0   úLiteral['after']r¹   r¾   r$   rÃ   r&   )r'   s   "r(   r)   r)   �  sD   € ÷ ]ñ ]Øð]ð ð]ð ð	]ð
 ð]ð Xñ]r+   c              ó   € R # ro   r&   )r.   r0   r¹   r¼   s   "$$*r(   rÁ   rÁ   �  s	   € ñ Z]r+   c               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r!   r.   r»   r¼   r0   r¸   r¹   r¾   rP   r   r$   zCallable[[Any], Any]r&   )r'   s   "r(   r)   r)   ™  sN   € ÷ iñ iØðið ðið ð	ið
 ðið  ðið ñir+   c              óš  aaaa€ \        V 4      '       g   \        V \        4      '       d   \        RRR7      hSR9  d   S\        Jd   \        RS: 2RR7      hS\        J d   SR8X  d   \
        oV .SO5o\        ;QJ d    R S 4       F  '       d   K   RM	  R	M! R S 4       4      '       g   \        R
RR7      hR VVVV3R llpV# )aÏ  !!! abstract "Usage Documentation"
    [field validators](../concepts/validators.md#field-validators)

Decorate methods on the class indicating that they should be used to validate fields.

Example usage:
```python
from typing import Any

from pydantic import (
    BaseModel,
    ValidationError,
    field_validator,
)

class Model(BaseModel):
    a: str

    @field_validator('a')
    @classmethod
    def ensure_foobar(cls, v: Any):
        if 'foobar' not in v:
            raise ValueError('"foobar" not found in a')
        return v

print(repr(Model(a='this is foobar good')))
#> Model(a='this is foobar good')

try:
    Model(a='snap')
except ValidationError as exc_info:
    print(exc_info)
    '''
    1 validation error for Model
    a
      Value error, "foobar" not found in a [type=value_error, input_value='snap', input_type=str]
    '''
```

For more in depth examples, see [Field Validators](../concepts/validators.md#field-validators).

Args:
    *fields: The field names the validator should apply to.
    mode: Specifies whether to validate the fields before or after validation.
    check_fields: Whether to check that the fields actually exist on the model.
    json_schema_input_type: The input type of the function. This is only used to generate
        the appropriate JSON Schema (in validation mode) and can only specified
        when `mode` is either `'before'`, `'plain'` or `'wrap'`.

Raises:
    PydanticUserError:
        - If the decorator is used without any arguments (at least one field name must be provided).
        - If the provided field names are not strings.
        - If `json_schema_input_type` is provided with an unsupported `mode`.
        - If the decorator is applied to an instance method.
z�The `@field_validator` decorator cannot be used without arguments, at least one field must be provided. For example: `@field_validator('<field_name>', ...)`.zdecorator-missing-arguments©Úcoderx   z;`json_schema_input_type` can't be used when mode is set to zvalidator-input-typec              3  óB   "  € T F  p\        V\        4      x € K  	  R # 5iro   )Ú
isinstancer»   )Ú.0r.   s   & r(   Ú	<genexpr>Ú"field_validator.<locals>.<genexpr>ê  s   é € Ð:±6¨%Œz˜%¤×%Ð%³6ùs   ‚FTz™The provided field names to the `@field_validator` decorator should be strings. For example: `@field_validator('<field_name_1>', '<field_name_2>', ...).`zdecorator-invalid-fieldsc               ó    € V ^8„  d   QhRRRR/# )r!   ÚfzHCallable[..., Any] | staticmethod[Any, Any] | classmethod[Any, Any, Any]r$   ú(_decorators.PydanticDescriptorProxy[Any]r&   )r'   s   "r(   r)   Ú%field_validator.<locals>.__annotate__ñ  s    € ÷ @ñ @ØSð@à	1ñ@r+   c                óâ   <€ \         P                  ! V 4      '       d   \        R RR7      h\         P                  ! V 4      p \         P                  ! SSSSR7      p\         P
                  ! W4      # )zFThe `@field_validator` decorator cannot be applied to instance methodszvalidator-instance-methodrÊ   )r¼   r0   r¹   rP   )r   Úis_instance_method_from_sigr   Ú%ensure_classmethod_based_on_signatureÚFieldValidatorDecoratorInfoÚPydanticDescriptorProxy)rÒ   Údec_infor¹   r¼   rP   r0   s   & €€€€r(   ÚdecÚfield_validator.<locals>.decñ  sh   ø€ ô ×2Ò2°1×5Ò5Ü#ØXØ0ôð ô ×=Ò=¸aÓ@ˆä×:Ò:Ø °<ÐXnô
ˆô ×2Ò2°1Ó?Ð?r+   )rT   rx   rˆ   )ÚcallablerÍ   rL   r   r   r   Úall)r.   r0   r¹   rP   r¼   rÛ   s   "dddj r(   rÁ   rÁ   ™  sË   û€ ô@ �‡‚œ* U¬K×8Ò8ÜðDà.ô
ð 	
ð Ð.Ô.Ð3IÔQbÓ3bÜØIÈ$ÉÐRØ'ô
ð 	
ð
 Ô!2Ó2°t¸w´Ü!$Ðàˆ^�V‰^€Fß‹3Ñ:±6Ó:�3�3Š3Ñ:±6Ó:×:Ò:ÜðXà+ô
ð 	
÷@ó @ð" €Jr+   Ú
_ModelTypeÚ_ModelTypeCo)Ú	covariantc                  ó*   € ] tR tRtRtRR R lltRtR# )ÚModelWrapValidatorHandleri	  z]`@model_validator` decorated function handler argument type. This is used when `mode='wrap'`.Nc               ó$   € V ^8„  d   QhRRRRRR/# )r!   r•   r   Úouter_locationzstr | int | Noner$   rà   r&   )r'   s   "r(   r)   Ú&ModelWrapValidatorHandler.__annotate__  s(   € ÷ ñ àðð )ðð
 
ñr+   c               	ó   € R # ro   r&   )r9   r•   rå   s   """r(   r™   Ú"ModelWrapValidatorHandler.__call__  s   € ñ 	r+   r&   ro   ©rF   rG   rH   rI   rJ   r™   rM   r&   r+   r(   rã   rã   	  s   † Ùg÷ó r+   rã   c                  ó&   € ] tR tRtRtR R ltRtR# )ÚModelWrapValidatorWithoutInfoi  z�A `@model_validator` decorated function signature.
This is used when `mode='wrap'` and the function does not have info argument.
c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r!   rC   útype[_ModelType]r•   r   r#   ú%ModelWrapValidatorHandler[_ModelType]r$   rß   r&   )r'   s   "r(   r)   Ú*ModelWrapValidatorWithoutInfo.__annotate__  s2   € ÷ 	ñ 	àð	ð ð	ð 7ð	ð 
ñ	r+   c               	ó   € R # ro   r&   r«   s   """"r(   r™   Ú&ModelWrapValidatorWithoutInfo.__call__  s   € ñ r+   r&   Nré   r&   r+   r(   rë   rë     s   † ñ÷	ñ 	r+   rë   c                  ó&   € ] tR tRtRtR R ltRtR# )ÚModelWrapValidatori&  zSA `@model_validator` decorated function signature. This is used when `mode='wrap'`.c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r!   rC   rí   r•   r   r#   rî   rb   zcore_schema.ValidationInfor$   rß   r&   )r'   s   "r(   r)   ÚModelWrapValidator.__annotate__)  s<   € ÷ 
ñ 
àð
ð ð
ð 7ð
ð )ð
ð 
ñ
r+   c               	ó   € R # ro   r&   r²   s   """""r(   r™   ÚModelWrapValidator.__call__)  s   € ñ r+   r&   Nré   r&   r+   r(   ró   ró   &  s   † Ù]÷
ñ 
r+   ró   c                  ó&   € ] tR tRtRtR R ltRtR# )Ú#FreeModelBeforeValidatorWithoutInfoi6  úƒA `@model_validator` decorated function signature.
This is used when `mode='before'` and the function does not have info argument.
c               ó    € V ^8„  d   QhRRRR/# )r!   r•   r   r$   r&   )r'   s   "r(   r)   Ú0FreeModelBeforeValidatorWithoutInfo.__annotate__;  s    € ÷ ñ ð
 ðð 
ñr+   c               	ó   € R # ro   r&   )r9   r•   s   ""r(   r™   Ú,FreeModelBeforeValidatorWithoutInfo.__call__;  s   € ñ r+   r&   Nré   r&   r+   r(   rù   rù   6  s   † ñ÷ñ r+   rù   c                  ó&   € ] tR tRtRtR R ltRtR# )ÚModelBeforeValidatorWithoutInfoiE  rú   c               ó$   € V ^8„  d   QhRRRRRR/# r”   r&   )r'   s   "r(   r)   Ú,ModelBeforeValidatorWithoutInfo.__annotate__J  s(   € ÷ ñ àðð ðð 
ñr+   c               	ó   € R # ro   r&   r˜   s   """r(   r™   Ú(ModelBeforeValidatorWithoutInfo.__call__J  ó   € ñ r+   r&   Nré   r&   r+   r(   r   r   E  s   † ñ÷ñ r+   r   c                  ó&   € ] tR tRtRtR R ltRtR# )ÚFreeModelBeforeValidatoriU  úUA `@model_validator` decorated function signature. This is used when `mode='before'`.c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r•   r   rb   r    r$   r&   )r'   s   "r(   r)   Ú%FreeModelBeforeValidator.__annotate__X  s*   € ÷ ñ ð
 ðð .ðð 
ñr+   c               	ó   € R # ro   r&   )r9   r•   rb   s   """r(   r™   Ú!FreeModelBeforeValidator.__call__X  r  r+   r&   Nré   r&   r+   r(   r  r  U  s   † Ù_÷ñ r+   r  c                  ó&   € ] tR tRtRtR R ltRtR# )ÚModelBeforeValidatoric  r  c               ó(   € V ^8„  d   QhRRRRRRRR/# rŸ   r&   )r'   s   "r(   r)   Ú!ModelBeforeValidator.__annotate__f  s2   € ÷ 	ñ 	àð	ð ð	ð .ð	ð 
ñ	r+   c               	ó   € R # ro   r&   r£   s   """"r(   r™   ÚModelBeforeValidator.__call__f  s   € ñ r+   r&   Nré   r&   r+   r(   r  r  c  s   † Ù_÷	ñ 	r+   r  c               ó    € V ^8„  d   QhRRRR/# )r!   r0   r½   r$   z|Callable[[_AnyModelWrapValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]]r&   )r'   s   "r(   r)   r)   ‚  s   € ÷ ñ à
ððñr+   c                ó   € R # ro   r&   ©r0   s   $r(   Úmodel_validatorr  �  ó   € ñ r+   c               ó    € V ^8„  d   QhRRRR/# )r!   r0   zLiteral['before']r$   zrCallable[[_AnyModelBeforeValidator], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]]r&   )r'   s   "r(   r)   r)   ‹  s   € ÷ ñ à
ððñr+   c                ó   € R # ro   r&   r  s   $r(   r  r  Š  r  r+   c               ó    € V ^8„  d   QhRRRR/# )r!   r0   rÆ   r$   z}Callable[[_AnyModelAfterValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]]r&   )r'   s   "r(   r)   r)   ”  s   € ÷ ñ à
ððñr+   c                ó   € R # ro   r&   r  s   $r(   r  r  “  r  r+   c               ó    € V ^8„  d   QhRRRR/# )r!   r0   z"Literal['wrap', 'before', 'after']r$   r   r&   )r'   s   "r(   r)   r)   œ  s"   € ÷ Añ Aà
,ðAð 	ñAr+   c                ó   a € R V 3R llpV# )a¼  !!! abstract "Usage Documentation"
    [Model Validators](../concepts/validators.md#model-validators)

Decorate model methods for validation purposes.

Example usage:
```python
from typing_extensions import Self

from pydantic import BaseModel, ValidationError, model_validator

class Square(BaseModel):
    width: float
    height: float

    @model_validator(mode='after')
    def verify_square(self) -> Self:
        if self.width != self.height:
            raise ValueError('width and height do not match')
        return self

s = Square(width=1, height=1)
print(repr(s))
#> Square(width=1.0, height=1.0)

try:
    Square(width=1, height=2)
except ValidationError as e:
    print(e)
    '''
    1 validation error for Square
      Value error, width and height do not match [type=value_error, input_value={'width': 1, 'height': 2}, input_type=dict]
    '''
```

For more in depth examples, see [Model Validators](../concepts/validators.md#model-validators).

Args:
    mode: A required string literal that specifies the validation mode.
        It can be one of the following: 'wrap', 'before', or 'after'.

Returns:
    A decorator that can be used to decorate a function to be used as a model validator.
c               ó    € V ^8„  d   QhRRRR/# )r!   rÒ   r   r$   rÓ   r&   )r'   s   "r(   r)   Ú%model_validator.<locals>.__annotate__Í  s   € ÷ @ñ @ˆsð @Ð?ñ @r+   c                ó  <€ \         P                  ! V 4      p SR 8X  d@   \        V \        4      '       d*   \        P
                  ! \        R\        4        R2^R7       \         P                  ! SR7      p\         P                  ! W4      # )r-   zŸUsing `@model_validator` with mode='after' on a classmethod is deprecated. Instead, use an instance method. See the documentation at https://docs.pydantic.dev/z,/concepts/validators/#model-after-validator.)ÚcategoryÚmessageÚ
stacklevelr  )
r   r×   rÍ   rL   ÚwarningsÚwarnr   r   ÚModelValidatorDecoratorInforÙ   )rÒ   rÚ   r0   s   & €r(   rÛ   Úmodel_validator.<locals>.decÍ  sx   ø€ ä×=Ò=¸aÓ@ˆØ�7Œ?œz¨!¬[×9Ò9Ü�MŠMÜ3ðJÜJWË/ÐIZð  [GðHð õô ×:Ò:ÀÔEˆÜ×2Ò2°1Ó?Ð?r+   r&   )r0   rÛ   s   d r(   r  r  œ  s   ø€ ÷b@ð @ð  €Jr+   ÚAnyTypec                  ó^   € ] tR tRtRt]R R l4       t]R R l4       t]P                  t	Rt
R# )	Ú
InstanceOfié  uÎ  Generic type for annotating a type that is an instance of a given class.

Example:
    ```python
    from pydantic import BaseModel, InstanceOf

    class Foo:
        ...

    class Bar(BaseModel):
        foo: InstanceOf[Foo]

    Bar(foo=Foo())
    try:
        Bar(foo=42)
    except ValidationError as e:
        print(e)
        """
        [
        â”‚   {
        â”‚   â”‚   'type': 'is_instance_of',
        â”‚   â”‚   'loc': ('foo',),
        â”‚   â”‚   'msg': 'Input should be an instance of Foo',
        â”‚   â”‚   'input': 42,
        â”‚   â”‚   'ctx': {'class': 'Foo'},
        â”‚   â”‚   'url': 'https://errors.pydantic.dev/0.38.0/v/is_instance_of'
        â”‚   }
        ]
        """
    ```
c               ó    € V ^8„  d   QhRRRR/# )r!   Úitemr(  r$   r&   )r'   s   "r(   r)   ÚInstanceOf.__annotate__  s   € ÷ 	*ñ 	*¨ð 	*°Wñ 	*r+   c                	ó(   € \         W! 4       3,          # ro   )r   ©rC   r,  s   &&r(   Ú__class_getitem__ÚInstanceOf.__class_getitem__  s   € ä˜T 3£5˜[Õ)Ð)r+   c               ó$   € V ^8„  d   QhRRRRRR/# ©r!   Úsourcer   r#   r   r$   r%   r&   )r'   s   "r(   r)   r-    s(   € ÷ 	xñ 	x°cð 	xÐDXð 	xÐ]sñ 	xr+   c                	ó  € ^ RI Hp \        P                  ! \        P
                  ! V4      ;'       g    T4      p V! V4      p\        P                  ! R VR7      VR&   \        P                  ! WER7      #   T d    Tu # i ; i)rk   )ÚGENERATE_SCHEMA_ERRORSc                ó   € V! V 4      # ro   r&   rp   s   &&r(   rs   Ú9InstanceOf.__get_pydantic_core_schema__.<locals>.<lambda>  ru   r+   ©rv   r3   rm   )Úpython_schemaÚjson_schema)Ú#pydantic._internal._generate_schemar6  r   Úis_instance_schemar   Ú
get_originr{   Újson_or_python_schema)rC   r4  r#   r6  Úinstance_of_schemaÚoriginal_schemas   &&&   r(   r;   Ú'InstanceOf.__get_pydantic_core_schema__  s…   € åRô "-×!?Ò!?Ä	×@TÒ@TÐU[Ó@\×@fÐ@fÐ`fÓ!gÐðxá")¨&£/�ô 7B×6eÒ6eÙ.°ô7Ð" ?Ñ3ô #×8Ò8ÐGYÔwÐwøð *ô *à)Ò)ð*ús   ¼A7 Á7	BÂBr&   N)rF   rG   rH   rI   rJ   rL   r0  r;   ÚobjectÚ__hash__rM   r&   r+   r(   r*  r*  é  s=   † ñ	ð@ 
ô	*ó 
ð	*ð 
ô	xó 
ð	xð& —?‘?Œr+   r*  c                  óT   € ] tR tRtRtR R lt]R R l4       t]P                  t	Rt
R# )	ÚSkipValidationi*  at  If this is applied as an annotation (e.g., via `x: Annotated[int, SkipValidation]`), validation will be
    skipped. You can also use `SkipValidation[int]` as a shorthand for `Annotated[int, SkipValidation]`.

This can be useful if you want to use a type annotation for documentation/IDE/type-checking purposes,
and know that it is safe to skip validation for one or more of the fields.

Because this converts the validation schema to `any_schema`, subsequent annotation-applied transformations
may not have the expected effects. Therefore, when used, this annotation should generally be the final
annotation applied to a type.
c               ó    € V ^8„  d   QhRRRR/# )r!   r,  r   r$   r&   )r'   s   "r(   r)   ÚSkipValidation.__annotate__7  s   € ÷ 	5ñ 	5¨ð 	5°ñ 	5r+   c                	ó0   € \         V\        4       3,          # ro   )r   rF  r/  s   &&r(   r0  Ú SkipValidation.__class_getitem__7  s   € Ü˜T¤>Ó#3Ð3Õ4Ð4r+   c               ó$   € V ^8„  d   QhRRRRRR/# r3  r&   )r'   s   "r(   r)   rH  ;  s#   € ÷ 
	ñ 
	°cð 
	ÐDXð 
	Ð]sñ 
	r+   c                	ó,  a€ \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       V! V4      oRRR4       RV3R l./p\        P
                  ! V\        P                  ! R SR7      R7      #   + '       g   i     LH; i)ÚignoreNÚ pydantic_js_annotation_functionsc                ó   <€ V! S4      # ro   r&   )Ú_crr   rA  s   &&€r(   rs   Ú=SkipValidation.__get_pydantic_core_schema__.<locals>.<lambda>?  s
   ø€ É1È_ÔK]r+   c                ó   € V! V 4      # ro   r&   rp   s   &&r(   rs   rQ  C  ru   r+   r9  )Úmetadatarm   )r$  Úcatch_warningsÚsimplefilterr   r   Ú
any_schemar{   )rC   r4  r#   rS  rA  s   &&& @r(   r;   Ú+SkipValidation.__get_pydantic_core_schema__:  ss   ø€ ä×(Ò(×*Õ*Ü×%Ò% hÔ0DÔEÙ")¨&£/�÷ +ð ;Ô=]Ð<^Ð_ˆHÜ×)Ò)Ø!Ü)×MÒMÙ.°ôôð ÷	 +×*ús   Ÿ$BÂB	r&   N)rF   rG   rH   rI   rJ   r0  rL   r;   rC  rD  rM   r&   r+   r(   rF  rF  *  s+   † ñ		õ	5ð 
ô
	ó 
ð
	ð —?‘?Œr+   rF  Ú
_FromTypeTc                  ó2   € ] tR tRtRtR R ltR R ltRtR# )	Ú
ValidateAsiM  a-  A helper class to validate a custom type from a type that is natively supported by Pydantic.

Args:
    from_type: The type natively supported by Pydantic to use to perform validation.
    instantiation_hook: A callable taking the validated type as an argument, and returning
        the populated custom type.

Example:
    ```python {lint="skip"}
    from typing import Annotated

    from pydantic import BaseModel, TypeAdapter, ValidateAs

    class MyCls:
        def __init__(self, a: int) -> None:
            self.a = a

        def __repr__(self) -> str:
            return f"MyCls(a={self.a})"

    class Model(BaseModel):
        a: int


    ta = TypeAdapter(
        Annotated[MyCls, ValidateAs(Model, lambda v: MyCls(a=v.a))]
    )

    print(ta.validate_python({'a': 1}))
    #> MyCls(a=1)
    ```
c               ó$   € V ^8„  d   QhRRRRRR/# )r!   Úinstantiation_hookzCallable[[_FromTypeT], Any]Ú	from_typeztype[_FromTypeT]r$   ÚNoner&   )r'   s   "r(   r)   ÚValidateAs.__annotate__p  s$   € ÷ 5ñ 5ÐKfð 5Ð"2ð 5Ðkoñ 5r+   c               	ó   € Wn         W n        R # ro   ©r]  r\  )r9   r]  r\  s   ""&r(   Ú__init__ÚValidateAs.__init__p  s   € Ø"ŒØ"4Ör+   c               ó$   € V ^8„  d   QhRRRRRR/# r3  r&   )r'   s   "r(   r)   r_  t  s#   € ÷ 
ñ 
°3ð 
ÐAUð 
ÐZpñ 
r+   c                	ój   € V! V P                   4      p\        P                  ! V P                  VR 7      # )r2   )r]  r   r8   r\  )r9   r4  r#   r3   s   &&& r(   r;   Ú'ValidateAs.__get_pydantic_core_schema__t  s/   € Ù˜Ÿ™Ó(ˆÜ×;Ò;Ø×#Ñ#Øô
ð 	
r+   ra  N)rF   rG   rH   rI   rJ   rb  r;   rM   r&   r+   r(   rZ  rZ  M  s   † ñõD5÷
ñ 
r+   rZ  )é   é   r&   )rT   r-   rˆ   rx   )XÚ__conditional_annotations__rJ   Ú
__future__r   Ú_annotationsÚdataclassesÚsysr$  Ú	functoolsr   Útypingr   r   r   r   r   r	   r
   r   r   Úpydantic_corer   r   Útyping_extensionsr   r   Ú	_internalr   r   r   Úannotated_handlersr   Úerrorsr   Úversionr   r   r   Úversion_infor   Úinspect_validatorr4   Ú	dataclassÚ
slots_truer   rO   rg   rƒ   r’   r�   r¦   r®   r5   r7   Ú_V2Validatorr‰   r‹   Ú_V2WrapValidatorrL   Ústaticmethodr´   rK   rµ   r·   r¸   rÁ   rß   rà   ÚValidatorFunctionWrapHandlerrã   rë   ró   rù   r   r  r  ÚModelAfterValidatorWithoutInfoÚValidationInfoÚModelAfterValidatorÚ_AnyModelWrapValidatorÚ_AnyModelBeforeValidatorÚ_AnyModelAfterValidatorr  r(  r*  rF  rX  rZ  )ri  s   @r(   Ú<module>r„     sí  øðÜ Hå 2ã Û 
Û Ý #ß c× cÕ cç 8ß -ç BÑ BÝ 4Ý %Ý "ß Fà×Ñ�gÔÞ*åà ×2Ñ2Ð ð ×ÒÑE˜dÐEÐ&9×&DÑ&DÑE÷9(ð 9(ó Fð9(ðx ×ÒÑE˜dÐEÐ&9×&DÑ&DÑE÷?
ð ?
ó Fð?
ðD ×ÒÑE˜dÐEÐ&9×&DÑ&DÑE÷`
ð `
ó Fð`
ðF ×ÒÑE˜dÐEÐ&9×&DÑ&DÑE÷G
ð G
ó FðG
÷T ô@ xô @ôg ô gôs¨8ô sô Hô ð ØØ×-Ñ-Ø$Ø×+Ñ+ð	-õ€Lð Ø!Ø×1Ñ1Ø(Ø×/Ñ/ð	1õÐð ,1°¸SÀ#Às¸]Õ1KÈ\ÐZ]Ð_bÐZbÕMcÐerÐsvÕewÐ1wÕ+xÐ˜yÓxá)0Ø,Ø�LÐ";Ð;Õ<ô*Ð&ñ #Ð#9ÀÐGWÐYrÐGrÕAsÔtÐà!(Ð)KÕ!LÐ �YÓ Lð 
ðAð
 !$ðAð #&öAó 
ðAð 
ð]ð
 !$ð]ð #&ö]ó 
ð]ð 
ð]ð !ð	]ð
 !$ö]ó 
ð]ðið !(ð	ið
 !%ðið #4÷iñX �\Ó"€
Ù�~°Ô6€ô	 × HÑ HÈ(ÐS_ÕJ`ô 	ô H¨ZÕ$8ô ô"˜ *Õ-ô ô ¨(ô ô hô ô ˜xô ô˜8ô ð "*¨:¨,¸
Ð*BÕ!CÐ ðð  
¨K×,FÑ,FÀsÕ,KÐLÈjÐXÕYÐ Ø ZàÐ1°*Õ=Ð?\Ð]gÕ?hÐhÕiÐ Ø ØÐ2Ð4WÐYxÐxõÐ ð  Ð 3°JÕ ?ÐA_Ð`jÕAkÐ kÕlÐ ð 
ôó 
ðð 
ôó 
ðð 
ôó 
ðõAñH �)Ó
€÷ à˜7 C˜<Õ(�Jð ×ÒÑ<Ð0×;Ñ;Ñ<÷9#ð 9#ó =ð9#÷x Ø˜w¨˜|Õ,�Nð ×ÒÑ<Ð0×;Ñ;Ñ<÷#ð #ó =ð#ñ> �\Ó"€
÷,
ó ,
r+   