
    bMhxs                    4   U d Z ddlmZ ddlZddlZddlmZ ddlm	Z	 ddl
mZmZmZmZmZmZmZmZmZ ddlmZmZ ddlmZ dd	lmZmZ d
dlmZmZmZ d
dlm Z  d
dl!m"Z" ej#        dk     rddlm$Z$ nddl
m$Z$ ej%        Z& ej'        d`ddiej(         G d d                      Z) ej'        d`ddiej(         G d d                      Z* ej'        d`ddiej(         G d d                      Z+ ej'        d`ddiej(         G d d                      Z,er G d de$          Z- G d de$          Z. G d de$          Z/ G d  d!e$          Z0ee.ej1        e-ej2        f         Z3ee0ej4        e/ej5        f         Z6ee7eeef         e8eef         ee         f         Z9d"e:d#<    ed$ee3e9f         %          Z; ed&ee6e9f         %          Z<ed'         Z=d"e:d(<   ed)d)d*dad6            Z>ed)d)d*dbd9            Z>ed)d)d:dcd<            Z>d=ded>ddd@Z> edA          Z? edBdC          Z@ G dD dEejA        e$e@                   ZB G dF dGe$e?                   ZC G dH dIe$e?                   ZD G dJ dKe$          ZE G dL dMe$          ZF G dN dOe$          ZG G dP dQe$          ZHee?ge?f         ZI	 ee?ejJ        ge?f         ZK	 eeDe?         eCe?         f         ZLeeGeHeEeFf         ZMeeKe?         eIe?         f         ZNededS            ZOedfdV            ZOedgdX            ZOdhdZZO ed[          ZPereePd)f         ZQn% ej'        d`i ej(         G d\ d]                      ZQereePd)f         ZRdS  ej'        d`i ej(         G d^ d_                      ZRdS )izBThis module contains related classes and functions for validation.    )annotationsN)partialmethod)FunctionType)	TYPE_CHECKING	AnnotatedAnyCallableLiteralTypeVarUnioncastoverload)PydanticUndefinedcore_schema)r   )Self	TypeAlias   )_decorators	_generics_internal_dataclass)GetCoreSchemaHandler)PydanticUserError)      )ProtocolfrozenTc                  >    e Zd ZU dZded<   dd
Zedd            ZdS )AfterValidatoraT  !!! 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funcsource_typer   handlerr   returncore_schema.CoreSchemac                &    ||          }t          | j        d          }|r;t          t          j        | j                  }t          j        |||j                  S t          t          j        | j                  }t          j        ||          S )Nafter)schema
field_name)r'   )	_inspect_validatorr    r   r   WithInfoValidatorFunction"with_info_after_validator_functionr(   NoInfoValidatorFunction no_info_after_validator_function)selfr!   r"   r'   info_argr    s         ^/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pydantic/functional_validators.py__get_pydantic_core_schema__z+AfterValidator.__get_pydantic_core_schema__I   s    %%%di99 	U=tyIIDA$vbibtuuuu;TYGGD?VTTTT    	decorator>_decorators.Decorator[_decorators.FieldValidatorDecoratorInfo]r   c                $     | |j                   S )Nr    r6   clsr3   s     r0   _from_decoratorzAfterValidator._from_decoratorS   s    s	''''r2   Nr!   r   r"   r   r#   r$   r3   r4   r#   r   )__name__
__module____qualname____doc____annotations__r1   classmethodr9    r2   r0   r   r      sh         ( (T VUUUU U U U ( ( ( [( ( (r2   r   c                  L    e Zd ZU dZded<   eZded<   ddZedd            Z	dS )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 of the function. This is only used to generate the appropriate
            JSON Schema (in validation mode).

    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_typer!   r"   r   r#   r$   c                ~    ||          }| j         t          u rd n|                    | j                   }t          | j        d          }|r<t          t          j        | j                  }t          j        |||j	        |          S t          t          j
        | j                  }t          j        |||          S )Nbeforer'   r(   json_schema_input_schemar'   rI   )rE   r   generate_schemar)   r    r   r   r*   #with_info_before_validator_functionr(   r,   !no_info_before_validator_functionr.   r!   r"   r'   input_schemar/   r    s          r0   r1   z,BeforeValidator.__get_pydantic_core_schema__}   s    %% *.??? D(()DEE 	 &di:: 	=tyIIDB"-)5	    ;TYGGD@Vl   r2   r3   r4   r   c                :     | |j         |j        j                  S N)r    rE   r    inforE   r7   s     r0   r9   zBeforeValidator._from_decorator   (    s#,>#H
 
 
 	
r2   Nr:   r;   
r<   r=   r>   r?   r@   r   rE   r1   rA   r9   rB   r2   r0   rD   rD   X   sv          @ VUUU"33333   . 
 
 
 [
 
 
r2   rD   c                  L    e Zd ZU dZded<   eZded<   ddZedd            Z	dS )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 of the function. This is only used to generate the appropriate
            JSON Schema (in validation mode). If not provided, will default to `Any`.

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

        from pydantic import BaseModel, PlainValidator

        MyInt = Annotated[
            int,
            PlainValidator(
                lambda v: int(v) + 1, 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   rE   r!   r"   r   r#   r$   c           
        ddl m} 	  ||          }|                    dt          j        d ||                    |                              }n# |$ r d }Y nw xY w|                    | j                  }t          | j        d          }|r<t          t          j
        | j                  }t          j        ||j        ||          S t          t          j        | j                  }t          j        |||          S )	Nr   PydanticSchemaGenerationErrorserializationc                     ||           S NrB   vhs     r0   <lambda>z=PlainValidator.__get_pydantic_core_schema__.<locals>.<lambda>       !!A$$ r2   )functionr'   return_schemaplain)r(   r[   rI   )r[   rI   )pydanticrZ   getr   #wrap_serializer_function_ser_schemarK   rE   r)   r    r   r*   "with_info_plain_validator_functionr(   r,    no_info_plain_validator_function)	r.   r!   r"   rZ   r'   r[   rO   r/   r    s	            r0   r1   z+PlainValidator.__get_pydantic_core_schema__   s@    	;:::::	!W[))F #JJ?..!")"9"9+"F"F   MM - 	! 	! 	! MMM	! ..t/JKK%di99 	=tyIIDA"-+)5	    ;TYGGD?+)5   s   A
A AAr3   r4   r   c                :     | |j         |j        j                  S rQ   rR   r7   s     r0   r9   zPlainValidator._from_decorator   rT   r2   Nr:   r;   )
r<   r=   r>   r?   r@   r   rE   r1   rA   r9   rB   r2   r0   rW   rW      sw         ( (T VUUU"%%%%%( ( ( (T 
 
 
 [
 
 
r2   rW   c                  L    e Zd ZU dZded<   eZded<   ddZedd            Z	dS )WrapValidatora  !!! 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 of the function. This is only used to generate the appropriate
            JSON Schema (in validation mode).

    ```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   rE   r!   r"   r   r#   r$   c                ~    ||          }| j         t          u rd n|                    | j                   }t          | j        d          }|r<t          t          j        | j                  }t          j        |||j	        |          S t          t          j
        | j                  }t          j        |||          S )NwraprH   rJ   )rE   r   rK   r)   r    r   r   WithInfoWrapValidatorFunction!with_info_wrap_validator_functionr(   NoInfoWrapValidatorFunctionno_info_wrap_validator_functionrN   s          r0   r1   z*WrapValidator.__get_pydantic_core_schema__(  s    %% *.??? D(()DEE 	 &di88 	A49MMD@"-)5	    ?KKD>)5   r2   r3   r4   r   c                :     | |j         |j        j                  S rQ   rR   r7   s     r0   r9   zWrapValidator._from_decoratorA  rT   r2   Nr:   r;   rU   rB   r2   r0   rm   rm      sv         $ $L ^]]]"33333   2 
 
 
 [
 
 
r2   rm   c                      e Zd ZddZdS )_OnlyValueValidatorClsMethodr8   r   valuer#   c                   d S r]   rB   r.   r8   rw   s      r0   __call__z%_OnlyValueValidatorClsMethod.__call__L        r2   Nr8   r   rw   r   r#   r   r<   r=   r>   rz   rB   r2   r0   rv   rv   K  s        ??????r2   rv   c                      e Zd Zd	dZdS )
_V2ValidatorClsMethodr8   r   rw   rS   _core_schema.ValidationInfor#   c                   d S r]   rB   r.   r8   rw   rS   s       r0   rz   z_V2ValidatorClsMethod.__call__O  r{   r2   Nr8   r   rw   r   rS   r   r#   r   r}   rB   r2   r0   r   r   N  s        bbbbbbr2   r   c                      e Zd Zd	dZdS )
 _OnlyValueWrapValidatorClsMethodr8   r   rw   r"   )_core_schema.ValidatorFunctionWrapHandlerr#   c                   d S r]   rB   r.   r8   rw   r"   s       r0   rz   z)_OnlyValueWrapValidatorClsMethod.__call__R  r{   r2   N)r8   r   rw   r   r"   r   r#   r   r}   rB   r2   r0   r   r   Q  s        ssssssr2   r   c                      e Zd Zdd	Zd
S )_V2WrapValidatorClsMethodr8   r   rw   r"   r   rS   r   r#   c                   d S r]   rB   r.   r8   rw   r"   rS   s        r0   rz   z"_V2WrapValidatorClsMethod.__call__U  s	     #r2   N)
r8   r   rw   r   r"   r   rS   r   r#   r   r}   rB   r2   r0   r   r   T  s(        	 	 	 	 	 	r2   r   r   _PartialClsOrStaticMethod"_V2BeforeAfterOrPlainValidatorType)bound_V2WrapValidatorType)rG   r&   ro   re   FieldValidatorModes.)check_fieldsrE   fieldstrfieldsmodeLiteral['wrap']r   bool | NonerE   r   r#   6Callable[[_V2WrapValidatorType], _V2WrapValidatorType]c                  d S r]   rB   r   r   r   rE   r   s        r0   field_validatorr   w  s
     >ASr2   Literal['before', 'plain']RCallable[[_V2BeforeAfterOrPlainValidatorType], _V2BeforeAfterOrPlainValidatorType]c                  d S r]   rB   r   s        r0   r   r     s     Z]Y\r2   )r   r   Literal['after']c                  d S r]   rB   )r   r   r   r   s       r0   r   r     s     Z]Y\r2   r&   )r   r   rE   Callable[[Any], Any]c              :   t          | t                    rt          dd          dvrt          urt          dd          t          u rdk    rt          | gR t          d D                       st          d	d
          dfd}|S )aO  !!! 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:
        field: The first field the `field_validator` should be called on; this is separate
            from `fields` to ensure an error is raised if you don't pass at least one.
        *fields: Additional field(s) the `field_validator` should be called on.
        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'`.

    Returns:
        A decorator that can be used to decorate a function to be used as a field_validator.

    Raises:
        PydanticUserError:
            - If `@field_validator` is used bare (with no fields).
            - If the args passed to `@field_validator` as fields are not strings.
            - If `@field_validator` applied to instance methods.
    z`@field_validator` should be used with fields and keyword arguments, not bare. E.g. usage should be `@validator('<field_name>', ...)`zvalidator-no-fieldscode)rG   re   ro   z;`json_schema_input_type` can't be used when mode is set to zvalidator-input-typere   c              3  @   K   | ]}t          |t                    V  d S r]   )
isinstancer   ).0r   s     r0   	<genexpr>z"field_validator.<locals>.<genexpr>  s,      ::%z%%%::::::r2   z`@field_validator` fields should be passed as separate string args. E.g. usage should be `@validator('<field_name_1>', '<field_name_2>', ...)`zvalidator-invalid-fieldsfHCallable[..., Any] | staticmethod[Any, Any] | classmethod[Any, Any, Any]r#   (_decorators.PydanticDescriptorProxy[Any]c                    t          j        |           rt          dd          t          j        |           } t          j                  }t          j        | |          S )Nz8`@field_validator` cannot be applied to instance methodszvalidator-instance-methodr   )r   r   r   rE   )r   is_instance_method_from_sigr   %ensure_classmethod_based_on_signatureFieldValidatorDecoratorInfoPydanticDescriptorProxy)r   dec_infor   r   rE   r   s     r0   deczfield_validator.<locals>.dec  s}     2155 	#JQl   
 =a@@:<Xn
 
 
 21h???r2   )r   r   r#   r   )r   r   r   r   r   all)r   r   r   rE   r   r   s    ```` r0   r   r     s   H %&& 
E&
 
 
 	
 ...3IQb3b3bR$RR'
 
 
 	

 !222tw!$^V^^F::6::::: 
Y+
 
 
 	
@ @ @ @ @ @ @ @ @  Jr2   
_ModelType_ModelTypeCo)	covariantc                      e Zd ZdZ	 d
dd	ZdS )ModelWrapValidatorHandlerz]`@model_validator` decorated function handler argument type. This is used when `mode='wrap'`.Nrw   r   outer_locationstr | int | Noner#   r   c                   d S r]   rB   )r.   rw   r   s      r0   rz   z"ModelWrapValidatorHandler.__call__  s	     	r2   r]   )rw   r   r   r   r#   r   r<   r=   r>   r?   rz   rB   r2   r0   r   r   
  s8        gg
 ,0      r2   r   c                      e Zd ZdZdd
ZdS )ModelWrapValidatorWithoutInfozA `@model_validator` decorated function signature.
    This is used when `mode='wrap'` and the function does not have info argument.
    r8   type[_ModelType]rw   r   r"   %ModelWrapValidatorHandler[_ModelType]r#   r   c                   d S r]   rB   r   s       r0   rz   z&ModelWrapValidatorWithoutInfo.__call__  s	     Sr2   N)r8   r   rw   r   r"   r   r#   r   r   rB   r2   r0   r   r     s2         	 	 	 	 	 	r2   r   c                      e Zd ZdZddZdS )ModelWrapValidatorzSA `@model_validator` decorated function signature. This is used when `mode='wrap'`.r8   r   rw   r   r"   r   rS   r   r#   r   c                   d S r]   rB   r   s        r0   rz   zModelWrapValidator.__call__*  s	     Sr2   N)
r8   r   rw   r   r"   r   rS   r   r#   r   r   rB   r2   r0   r   r   '  s.        ]]
 
 
 
 
 
r2   r   c                      e Zd ZdZddZdS )#FreeModelBeforeValidatorWithoutInfoA `@model_validator` decorated function signature.
    This is used when `mode='before'` and the function does not have info argument.
    rw   r   r#   c                   d S r]   rB   )r.   rw   s     r0   rz   z,FreeModelBeforeValidatorWithoutInfo.__call__<  s	     cr2   N)rw   r   r#   r   r   rB   r2   r0   r   r   7  s2              r2   r   c                      e Zd ZdZddZdS )	ModelBeforeValidatorWithoutInfor   r8   r   rw   r#   c                   d S r]   rB   ry   s      r0   rz   z(ModelBeforeValidatorWithoutInfo.__call__K  	     cr2   Nr|   r   rB   r2   r0   r   r   F  s2              r2   r   c                      e Zd ZdZd	dZdS )
FreeModelBeforeValidatorUA `@model_validator` decorated function signature. This is used when `mode='before'`.rw   r   rS   r   r#   c                   d S r]   rB   )r.   rw   rS   s      r0   rz   z!FreeModelBeforeValidator.__call__Y  r   r2   N)rw   r   rS   r   r#   r   r   rB   r2   r0   r   r   V  s.        __     r2   r   c                      e Zd ZdZd
dZd	S )ModelBeforeValidatorr   r8   r   rw   rS   r   r#   c                   d S r]   rB   r   s       r0   rz   zModelBeforeValidator.__call__g  s	     cr2   Nr   r   rB   r2   r0   r   r   d  s.        __	 	 	 	 	 	r2   r   |Callable[[_AnyModelWrapValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]]c                    d S r]   rB   r   s    r0   model_validatorr     	     3r2   Literal['before']rCallable[[_AnyModelBeforeValidator], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]]c                    d S r]   rB   r   s    r0   r   r     r   r2   }Callable[[_AnyModelAfterValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]]c                    d S r]   rB   r   s    r0   r   r     r   r2   "Literal['wrap', 'before', 'after']c                     d fd}|S )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.
    r   r   r#   r   c                    t          j        |           } t          j                  }t          j        | |          S )Nr   )r   r   ModelValidatorDecoratorInfor   )r   r   r   s     r0   r   zmodel_validator.<locals>.dec  s9    =a@@:EEE21h???r2   )r   r   r#   r   rB   )r   r   s   ` r0   r   r     s/    b@ @ @ @ @ @ Jr2   AnyTypec                  P    e Zd ZdZedd            Zedd            Zej        ZdS )
InstanceOfu  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'
                │   }
                ]
                """
            ```
        itemr   r#   c                0    t           | |             f         S r]   )r   r8   r   s     r0   __class_getitem__zInstanceOf.__class_getitem__  s    T3355[))r2   sourcer   r"   r   r$   c                    ddl m} t          j        t	          j        |          p|          }	  ||          }t          j        d |          |d<   t          j        ||          S # |$ r |cY S w xY w)Nr   rY   c                     ||           S r]   rB   r^   s     r0   ra   z9InstanceOf.__get_pydantic_core_schema__.<locals>.<lambda>  rb   r2   rc   r'   r[   )python_schemajson_schema)rf   rZ   r   is_instance_schemar   
get_originrh   json_or_python_schema)r8   r   r"   rZ   instance_of_schemaoriginal_schemas         r0   r1   z'InstanceOf.__get_pydantic_core_schema__  s    >>>>>> "-!?	@TU[@\@\@f`f!g!gx")'&// 7B6e..7 7 7"?3 #8GYgvwwww 1 * * *))))*s   A+ +A54A5N)r   r   r#   r   r   r   r"   r   r#   r$   )	r<   r=   r>   r?   rA   r   r1   object__hash__rB   r2   r0   r   r     sf        	 	@ 
	* 	* 	* 
	* 
	x 	x 	x 
	x& ?r2   r   c                  @    e Zd ZdZddZedd
            Zej        ZdS )SkipValidationa  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.
        r   r   r#   c                8    t           |t                      f         S r]   )r   r   r   s     r0   r   z SkipValidation.__class_getitem__.  s    T>#3#3344r2   r   r"   r   r$   c                     ||          dfdgi}t          j        |t          j        d                     S )N pydantic_js_annotation_functionsc                     |          S r]   rB   )_cr`   r   s     r0   ra   z=SkipValidation.__get_pydantic_core_schema__.<locals>.<lambda>4  s    11_K]K] r2   c                     ||           S r]   rB   r^   s     r0   ra   z=SkipValidation.__get_pydantic_core_schema__.<locals>.<lambda>8  rb   r2   r   )metadatar[   )r   
any_schemarh   )r8   r   r"   r   r   s       @r0   r1   z+SkipValidation.__get_pydantic_core_schema__1  sa    %gfooO:=]=]=]=]<^_H)!)M..     r2   N)r   r   r#   r   r   )	r<   r=   r>   r?   r   rA   r1   r   r   rB   r2   r0   r   r   !  sU        		 			5 	5 	5 	5 
	 	 	 
	 ?r2   r   rB   )r   r   r   r   r   r   r   r   rE   r   r#   r   )r   r   r   r   r   r   r   r   rE   r   r#   r   )
r   r   r   r   r   r   r   r   r#   r   )r   r   r   r   r   r   r   r   rE   r   r#   r   )r   r   r#   r   )r   r   r#   r   )r   r   r#   r   )r   r   r#   r   )Sr?   
__future__r   _annotationsdataclassessys	functoolsr   typesr   typingr   r   r   r	   r
   r   r   r   r   pydantic_corer   r   _core_schematyping_extensionsr   r   	_internalr   r   r   annotated_handlersr   errorsr   version_infor   inspect_validatorr)   	dataclass
slots_truer   rD   rW   rm   rv   r   r   r   r*   r,   _V2Validatorrp   rr   _V2WrapValidatorrA   staticmethodr   r@   r   r   r   r   r   r   ValidatorFunctionWrapHandlerr   r   r   r   r   r   r   ModelAfterValidatorWithoutInfoValidationInfoModelAfterValidator_AnyModelWrapValidator_AnyModelBeforeValidator_AnyModelAfterValidatorr   r   r   r   rB   r2   r0   <module>r     s   H H H 2 2 2 2 2 2     



 # # # # # #       c c c c c c c c c c c c c c c c c c c c c c 8 8 8 8 8 8 8 8 5 5 5 5 5 5 - - - - - - - - B B B B B B B B B B 4 4 4 4 4 4 % % % % % %g******* 2  EEdE&9&DEE9( 9( 9( 9( 9( 9( 9( FE9(x EEdE&9&DEE@
 @
 @
 @
 @
 @
 @
 FE@
F EEdE&9&DEE]
 ]
 ]
 ]
 ]
 ]
 ]
 FE]
@ EEdE&9&DEEH
 H
 H
 H
 H
 H
 H
 FEH
V  )u@ @ @ @ @x @ @ @c c c c c c c ct t t t t8 t t t    H    .$,	.L !2(0	2 ,1S#s]1K\Z]_bZbMcersvew1w+xxxxx)0,L";;<* * *& #7#9GWYrGrAsttt!()K!L  L L L L 
 !$"%A A A A A 
A 
 !$"%] ] ] ] ] 
] 

 ! #] ] ] ] ] 
] !( $"3l l l l l l^ W\""
w~666	 	 	 	 	 I8T`Ka 	 	 	    HZ$8   "    *-        (       h        x       8    "*:,
*B!C  
L,GH*TU  Z1*=?\]g?hhi  24WYxx    3J ?A_`jAk kl  
   
 
   
 
   
7 7 7 7t ')

  @#7C<(JJ [<<0;<<9# 9# 9# 9# 9# 9# 9# =<9#x  #w|,NNN [<<0;<<# # # # # # # =<# # #r2   