
    Xi{                    p   % S r SSKJr  SSKrSSKrSSKrSSKJr  SSK	J
r
JrJrJrJrJrJrJrJr  SSKJrJr  SSKJrJr  SS	KJrJrJr  SS
KJr  SSKJ r   SSK!J"r"  SSKJ#r#J$r$  \RJ                  S:  a  SSKJ&r&  OSSK	J&r&  \RN                  r(\RR                  " SOSS0\RT                  D6 " S S5      5       r+\RR                  " SOSS0\RT                  D6 " S S5      5       r,\RR                  " SOSS0\RT                  D6 " S S5      5       r-\RR                  " SOSS0\RT                  D6 " S S5      5       r.\
(       a   " S S\&5      r/ " S S\&5      r0 " S S\&5      r1 " S  S!\&5      r2\\0\Rf                  \/\Rh                  4   r5\\2\Rl                  \1\Rn                  4   r8\\9\\\4   \:\\4   \\   4   r;S"\<S#'   \" S$\\5\;4   S%9r=\" S&\\8\;4   S%9r>\S'   r?S"\<S('   \S)S)S*.           SPS+ jj5       r@\S)S)S*.           SQS, jj5       r@\S)S)S-.         SRS. jj5       r@S/S\S0.           SSS1 jjr@\" S25      rA\" S3SS49rB " S5 S6\R                  \&\B   5      rD " S7 S8\&\A   5      rE " S9 S:\&\A   5      rF " S; S<\&5      rG " S= S>\&5      rH " S? S@\&5      rI " SA SB\&5      rJ\\A/\A4   rK \\A\R                  \   /\A4   rM \\F\A   \E\A   4   rN\\I\J\G\H4   rO\\M\A   \K\A   4   rP\    STSC j5       rQ\    SUSD j5       rQ\    SVSE j5       rQ    SWSF jrQ\" SG5      rR\
(       a  \\RS)4   rSO)\RR                  " SO0 \RT                  D6 " SH SI5      5       rS\
(       a  \\RS)4   rTO)\RR                  " SO0 \RT                  D6 " SJ SK5      5       rT\" SL5      rU " SM SN5      rVg)XzBThis 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                  B    \ rS rSr% SrS\S'   S	S jr\S
S j5       rSr	g)AfterValidator   a  !!! 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                *   U" U5      n[        U R                  SSS9nU(       a8  [        [        R                  U R                  5      n[        R
                  " XSS9$ [        [        R                  U R                  5      n[        R                  " XSS9$ )Nafterfieldmodetypeschema)_inspect_validatorr#   r   r   WithInfoValidatorFunction"with_info_after_validator_functionNoInfoValidatorFunction no_info_after_validator_function)selfsource_typehandlerr+   info_argr#   s         Q/var/www/html/venv/lib/python3.13/site-packages/pydantic/functional_validators.py__get_pydantic_core_schema__+AfterValidator.__get_pydantic_core_schema__J   so    %%diigGL==tyyIDAA$VV;;TYYGD??TT    c                "    U " UR                   S9$ )Nr#   r:   cls	decorators     r5   _from_decoratorAfterValidator._from_decoratorT   s    	''r8    Nr2   r   r3   r   returncore_schema.CoreSchemar=   z>_decorators.Decorator[_decorators.FieldValidatorDecoratorInfo]rB   r   )
__name__
__module____qualname____firstlineno____doc____annotations__r6   classmethodr>   __static_attributes__r@   r8   r5   r    r       s+    (T VUU ( (r8   r    c                  P    \ rS rSr% SrS\S'   \rS\S'   SS jr\	SS j5       r
S	rg
)BeforeValidatorY   a,  !!! 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                   U" U5      nU R                   [        L a  S OUR                  U R                   5      n[        U R                  SSS9nU(       a:  [        [        R                  U R                  5      n[        R                  " UUUS9$ [        [        R                  U R                  5      n[        R                  " XcUS9$ )Nbeforer&   r'   r+   json_schema_input_schema)rP   r   generate_schemar,   r#   r   r   r-   #with_info_before_validator_functionr/   !no_info_before_validator_functionr1   r2   r3   r+   input_schemar4   r#   s          r5   r6   ,BeforeValidator.__get_pydantic_core_schema__~   s    % **.?? (()D)DE 	 &diihWM==tyyIDBB)5  ;;TYYGD@@l r8   c                L    U " UR                   UR                  R                  S9$ N)r#   rP   r#   inforP   r;   s     r5   r>   BeforeValidator._from_decorator   #    #,>>#H#H
 	
r8   r@   NrA   rD   rE   rF   rG   rH   rI   rJ   r   rP   r6   rK   r>   rL   r@   r8   r5   rN   rN   Y   s5    @ VU"3C3, 
 
r8   rN   c                  P    \ rS rSr% SrS\S'   \rS\S'   SS jr\	SS j5       r
S	rg
)PlainValidator   a  !!! 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           
        SSK Jn   U" U5      nUR                  S[        R                  " S UUR                  U5      S95      nUR                  U R                  5      n[        U R                  SSS9nU(       a:  [        [        R                  U R                  5      n[        R                  " UUUS	9$ [        [        R                  U R                  5      n[        R                  " UUUS	9$ ! U a    S n Nf = f)
Nr   )PydanticSchemaGenerationErrorserializationc                    U" U 5      $ Nr@   vhs     r5   <lambda>=PlainValidator.__get_pydantic_core_schema__.<locals>.<lambda>       !A$r8   )functionr+   return_schemaplainr&   r'   )rg   rT   )pydanticrf   getr   #wrap_serializer_function_ser_schemarU   rP   r,   r#   r   r-   "with_info_plain_validator_functionr/    no_info_plain_validator_function)	r1   r2   r3   rf   r+   rg   rY   r4   r#   s	            r5   r6   +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   >C1 1C<;C<c                L    U " UR                   UR                  R                  S9$ r\   r]   r;   s     r5   r>   PlainValidator._from_decorator   r`   r8   r@   NrA   rD   )rE   rF   rG   rH   rI   rJ   r   rP   r6   rK   r>   rL   r@   r8   r5   rc   rc      s6    ,\ VU"%C%'R 
 
r8   rc   c                  P    \ rS rSr% SrS\S'   \rS\S'   SS jr\	SS j5       r
S	rg
)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                   U" U5      nU R                   [        L a  S OUR                  U R                   5      n[        U R                  SSS9nU(       a:  [        [        R                  U R                  5      n[        R                  " UUUS9$ [        [        R                  U R                  5      n[        R                  " UUUS9$ )Nwrapr&   r'   rS   )rP   r   rU   r,   r#   r   r   WithInfoWrapValidatorFunction!with_info_wrap_validator_functionNoInfoWrapValidatorFunctionno_info_wrap_validator_functionrX   s          r5   r6   *WrapValidator.__get_pydantic_core_schema__+  s    % **.?? (()D)DE 	 &diif7KAA499MD@@)5  ??KD>>)5 r8   c                L    U " UR                   UR                  R                  S9$ r\   r]   r;   s     r5   r>   WrapValidator._from_decoratorC  r`   r8   r@   NrA   rD   ra   r@   r8   r5   r|   r|      s5    $L ^]"3C30 
 
r8   r|   c                      \ rS rSrSS jrSrg)_OnlyValueValidatorClsMethodiM  c                   g ri   r@   r1   r<   values      r5   __call__%_OnlyValueValidatorClsMethod.__call__N  s    Cr8   r@   Nr<   r   r   r   rB   r   rE   rF   rG   rH   r   rL   r@   r8   r5   r   r   M  s    ?r8   r   c                      \ rS rSrSS jrSrg)_V2ValidatorClsMethodiP  c                   g ri   r@   r1   r<   r   r^   s       r5   r   _V2ValidatorClsMethod.__call__Q  s    cfr8   r@   Nr<   r   r   r   r^   core_schema.ValidationInfo[Any]rB   r   r   r@   r8   r5   r   r   P  s    fr8   r   c                      \ rS rSrSS jrSrg) _OnlyValueWrapValidatorClsMethodiS  c                   g ri   r@   r1   r<   r   r3   s       r5   r   )_OnlyValueWrapValidatorClsMethod.__call__T  s    orr8   r@   N)r<   r   r   r   r3   (core_schema.ValidatorFunctionWrapHandlerrB   r   r   r@   r8   r5   r   r   S  s    rr8   r   c                  2    \ rS rSr          SS jrSrg)_V2WrapValidatorClsMethodiV  c                   g ri   r@   r1   r<   r   r3   r^   s        r5   r   "_V2WrapValidatorClsMethod.__call__W  s     r8   r@   N)
r<   r   r   r   r3   r   r^   r   rB   r   r   r@   r8   r5   r   r   V  s7    		 	 >		
 2	 	r8   r   r   _PartialClsOrStaticMethod"_V2BeforeAfterOrPlainValidatorType)bound_V2WrapValidatorType)rR   r%   r   rr   FieldValidatorModes.)check_fieldsrP   c                  g ri   r@   r&   r(   r   rP   fieldss        r5   field_validatorr   y  s     >Ar8   c                  g ri   r@   r   s        r5   r   r     s	     Z]r8   )r(   r   c                  g ri   r@   )r&   r(   r   r   s       r5   r   r     s	     Z]r8   r%   )r(   r   rP   c              <  ^^^^ [        U 5      (       d  [        U [        5      (       a
  [        SSS9eTS;  a  T[        La  [        ST< 3SS9eT[        L a  TS:X  a  [
        mU /TQ7m[        S T 5       5      (       d
  [        S	S
S9e    SUUUU4S jjnU$ )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code)rR   rr   r   z;`json_schema_input_type` can't be used when mode is set to zvalidator-input-typerr   c              3  B   #    U  H  n[        U[        5      v   M     g 7fri   )
isinstancestr).0r&   s     r5   	<genexpr>"field_validator.<locals>.<genexpr>  s     :6%z%%%6s   zThe 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                   > [         R                  " U 5      (       a
  [        SSS9e[         R                  " U 5      n [         R                  " TTTTS9n[         R
                  " X5      $ )NzFThe `@field_validator` decorator cannot be applied to instance methodszvalidator-instance-methodr   )r   r(   r   rP   )r   is_instance_method_from_sigr   %ensure_classmethod_based_on_signatureFieldValidatorDecoratorInfoPydanticDescriptorProxy)fdec_infor   r   rP   r(   s     r5   decfield_validator.<locals>.dec  sh     22155#X0  ==a@::<Xn
 221??r8   )r   zHCallable[..., Any] | staticmethod[Any, Any] | classmethod[Any, Any, Any]rB   (_decorators.PydanticDescriptorProxy[Any])callabler   rK   r   r   r   all)r&   r(   r   rP   r   r   s    ```` r5   r   r     s    @ *UK88D.
 	
 ..3IQb3bI$R'
 	

 !22tw!$^V^F:6:::X+
 	
@S@	1@ @" Jr8   
_ModelType_ModelTypeCo)	covariantc                  2    \ rS rSrSr S     SS jjrSrg)ModelWrapValidatorHandleri	  z]`@model_validator` decorated function handler argument type. This is used when `mode='wrap'`.Nc                   g ri   r@   )r1   r   outer_locations      r5   r   "ModelWrapValidatorHandler.__call__  s     	r8   r@   ri   )r   r   r   zstr | int | NonerB   r   rE   rF   rG   rH   rI   r   rL   r@   r8   r5   r   r   	  s0    g
 ,0 )
 
 r8   r   c                  2    \ rS rSrSr        SS jrSrg)ModelWrapValidatorWithoutInfoi  zA `@model_validator` decorated function signature.
This is used when `mode='wrap'` and the function does not have info argument.
c                   g ri   r@   r   s       r5   r   &ModelWrapValidatorWithoutInfo.__call__  s     r8   r@   N)r<   type[_ModelType]r   r   r3   %ModelWrapValidatorHandler[_ModelType]rB   r   r   r@   r8   r5   r   r     s2    		 	 7	 
	r8   r   c                  6    \ rS rSrSr          SS jrSrg)ModelWrapValidatori&  zSA `@model_validator` decorated function signature. This is used when `mode='wrap'`.c                   g ri   r@   r   s        r5   r   ModelWrapValidator.__call__)  s     r8   r@   N)
r<   r   r   r   r3   r   r^   zcore_schema.ValidationInforB   r   r   r@   r8   r5   r   r   &  s:    ]

 
 7
 )
 

r8   r   c                  *    \ rS rSrSr    SS jrSrg)#FreeModelBeforeValidatorWithoutInfoi6  A `@model_validator` decorated function signature.
This is used when `mode='before'` and the function does not have info argument.
c                   g ri   r@   )r1   r   s     r5   r   ,FreeModelBeforeValidatorWithoutInfo.__call__;  s     r8   r@   N)r   r   rB   r   r   r@   r8   r5   r   r   6  s     
  
r8   r   c                  .    \ rS rSrSr      SS jrSrg)ModelBeforeValidatorWithoutInfoiE  r   c                   g ri   r@   r   s      r5   r   (ModelBeforeValidatorWithoutInfo.__call__J       r8   r@   Nr   r   r@   r8   r5   r   r   E  s(      
r8   r   c                  .    \ rS rSrSr      SS jrSrg)FreeModelBeforeValidatoriU  UA `@model_validator` decorated function signature. This is used when `mode='before'`.c                   g ri   r@   )r1   r   r^   s      r5   r   !FreeModelBeforeValidator.__call__X  r   r8   r@   N)r   r   r^   r   rB   r   r   r@   r8   r5   r   r   U  s(    _
  . 
r8   r   c                  2    \ rS rSrSr        SS jrSrg)ModelBeforeValidatoric  r   c                   g ri   r@   r   s       r5   r   ModelBeforeValidator.__call__f  s     r8   r@   Nr   r   r@   r8   r5   r   r   c  s0    _		 	 .	 
	r8   r   c                    g ri   r@   r(   s    r5   model_validatorr          r8   c                    g ri   r@   r   s    r5   r   r     r   r8   c                    g ri   r@   r   s    r5   r   r     r   r8   c                   ^  SU 4S jjnU$ )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                  > [         R                  " U 5      n TS:X  a;  [        U [        5      (       a&  [        R
                  " [        S[        5        S3SS9  [         R                  " TS9n[         R                  " X5      $ )Nr%   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   rK   warningswarnr   r   ModelValidatorDecoratorInfor   )r   r   r(   s     r5   r   model_validator.<locals>.dec  sx    ==a@7?z![99MM3JJW/IZ  [GH  ::E221??r8   )r   r   rB   r   r@   )r(   r   s   ` r5   r   r     s    b@  Jr8   AnyTypec                  X    \ rS rSrSr\SS j5       r\SS j5       r\R                  r	Sr
g)	
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                     [         X" 5       4   $ ri   )r   r<   items     r5   __class_getitem__InstanceOf.__class_getitem__  s    T35[))r8   c                    SSK Jn  [        R                  " [        R
                  " U5      =(       d    U5      n U" U5      n[        R                  " S US9US'   [        R                  " XES9$ ! U a    Us $ f = f)Nr   )GENERATE_SCHEMA_ERRORSc                    U" U 5      $ ri   r@   rj   s     r5   rm   9InstanceOf.__get_pydantic_core_schema__.<locals>.<lambda>  ro   r8   rp   r+   rg   )python_schemajson_schema)#pydantic._internal._generate_schemar  r   is_instance_schemar   
get_originru   json_or_python_schema)r<   sourcer3   r  instance_of_schemaoriginal_schemas         r5   r6   'InstanceOf.__get_pydantic_core_schema__  s    R "-!?!?	@T@TU[@\@f`f!gx")&/ 7B6e6e.7"?3 #88GYww * *))*s   A0 0A;:A;r@   N)r   r   rB   r   r  r   r3   r   rB   rC   )rE   rF   rG   rH   rI   rK   r   r6   object__hash__rL   r@   r8   r5   r   r     s=    	@ 
	* 
	* 
	x 
	x& ??r8   r   c                  N    \ rS rSrSrSS jr\SS j5       r\R                  r	Sr
g)	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                (    [         U[        5       4   $ ri   )r   r  r   s     r5   r    SkipValidation.__class_getitem__7  s    T>#3344r8   c                  ^ [         R                  " 5          [         R                  " S[        5        U" U5      mS S S 5        SU4S j/0n[        R
                  " U[        R                  " S TS9S9$ ! , (       d  f       N@= f)Nignore pydantic_js_annotation_functionsc                   > U" T5      $ ri   r@   )_crl   r  s     r5   rm   =SkipValidation.__get_pydantic_core_schema__.<locals>.<lambda>?  s
    1_K]r8   c                    U" U 5      $ ri   r@   rj   s     r5   rm   r  C  ro   r8   r  )metadatarg   )r   catch_warningssimplefilterr   r   
any_schemaru   )r<   r  r3   r  r  s       @r5   r6   +SkipValidation.__get_pydantic_core_schema__:  sp    ((*%%h0DE")&/ + ;=]<^_H))!)MM. 	 +*s   $A55
Br@   N)r   r   rB   r   r  )rE   rF   rG   rH   rI   r   rK   r6   r  r  rL   r@   r8   r5   r  r  *  s+    			5 

	 

	 ??r8   r  
_FromTypeTc                  ,    \ rS rSrSrSS jrSS jrSrg)	
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                   Xl         X l        g ri   	from_typeinstantiation_hook)r1   r(  r)  s      r5   __init__ValidateAs.__init__p  s    ""4r8   c                d    U" U R                   5      n[        R                  " U R                  US9$ )Nr*   )r(  r   r0   r)  )r1   r  r3   r+   s       r5   r6   'ValidateAs.__get_pydantic_core_schema__t  s/    (;;##
 	
r8   r'  N)r)  zCallable[[_FromTypeT], Any]r(  ztype[_FromTypeT]rB   Noner  )rE   rF   rG   rH   rI   r*  r6   rL   r@   r8   r5   r%  r%  M  s    D5
r8   r%  r@   )r&   r   r   r   r(   Literal['wrap']r   bool | NonerP   r   rB   z6Callable[[_V2WrapValidatorType], _V2WrapValidatorType])r&   r   r   r   r(   zLiteral['before', 'plain']r   r0  rP   r   rB   RCallable[[_V2BeforeAfterOrPlainValidatorType], _V2BeforeAfterOrPlainValidatorType])
r&   r   r   r   r(   Literal['after']r   r0  rB   r1  )r&   r   r   r   r(   r   r   r0  rP   r   rB   zCallable[[Any], Any])r(   r/  rB   z|Callable[[_AnyModelWrapValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]])r(   zLiteral['before']rB   zrCallable[[_AnyModelBeforeValidator], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]])r(   r2  rB   z}Callable[[_AnyModelAfterValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]])r(   z"Literal['wrap', 'before', 'after']rB   r   )WrI   
__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_validatorr,   	dataclass
slots_truer    rN   rc   r|   r   r   r   r   r-   r/   _V2Validatorr   r   _V2WrapValidatorrK   staticmethodr   rJ   r   r   r   r   r   r   ValidatorFunctionWrapHandlerr   r   r   r   r   r   r   ModelAfterValidatorWithoutInfoValidationInfoModelAfterValidator_AnyModelWrapValidator_AnyModelBeforeValidator_AnyModelAfterValidatorr   r   r   r  r#  r%  r@   r8   r5   <module>rM     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
 A  A <A 
A 
 !$"%]] ] %	]
 ]  ] X] 
] 

 ! #]] ] 	]
 ] X] 
] !( $"3ii i 	i
 i  i 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
,A 	AH )
 7C<(J <0;;<9# 9# =9#x w|,N <0;;<# # =#> \"
,
 ,
r8   