+
    Ai{                      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   "\/var/www/html/photoedit/myenv/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    %%diigGL==tyyIDAA$VV;;TYYGD??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 	 &diihWM==tyyIDBB)5  ;;TYYGD@@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 Li ; 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 #JJ??.!")"9"9+"FM ..t/J/JK%diigGL==tyyIDAA+)5  ;;TYYGD??+)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 	 &diif7KAA499MD@@)5  ??KD>>)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fCf7V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rCr:brjm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.
zThe `@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%%%6s   FTzThe 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2155#X0  ==a@::<Xn
 221??r+   )rT   rx   r   )callabler   rL   r   r   r   all)r.   r0   r   rP   r   r   s   "dddj r(   r   r     s    @ *UK88D.
 	
 ..3IQb3bI$R'
 	

 !22tw!$^V^F3:6:333: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  zA `@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-   zUsing `@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MM3JJW/IZ  [GH  ::E221??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    T35[))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@TU[@\@f@f`f!gx")&/ 7B6e6e.7"?3 #88GY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    ((**%%h0D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 5Kf 5"2 5ko 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  EdE&9&D&DE9( 9( F9(x EdE&9&D&DE?
 ?
 F?
D EdE&9&D&DE`
 `
 F`
F Ed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]_bZbMcersvew1w+xyx)0,L";;<*& ##9GWYrGrAst!()K!L Y L 
A
 !$A #&A 
A 
]
 !$] #&] 
] 
] !	]
 !$] 
]i !(	i
 !%i #4iX \"
~6	 H H(S_J` 	HZ$8 "*-  ( h  x 8  "*:,
*B!C  
K,F,Fs,KLjXY  Z1*=?\]g?hhi  24WYxx    3J ?A_`jAk kl  
 
 
 
 
 
AH )
 7C<(J <0;;<9# 9# =9#x w|,N <0;;<# # =#> \"
,
 ,
r+   