
    ]fz                       d Z ddlmZ ddlZddlZddlZddlZddlZddl	m
Z
 ddlmZ ddlmZ ddlmZmZmZmZ ddlZddlmZmZ dd	l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! ddl"m#Z#m$Z$m%Z%m&Z& ddl'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7m8Z8m9Z9m:Z: ddl;m<Z<m=Z= ddl>m?Z? ej@        rd
dlAmBZC d
dlAmDZDmEZE d
dlAmFZG d
dlHmIZI neZJ eK            ZC eK            ZGeKjL        ZM G d deN          ZO ed eCeGf!           G d" d#e
                      ZPdQd*ZQdRd0ZRdSd6ZSdTd9ZTdUd:ZUdVd>ZVd dd?dWdGZWdXdHZX G dI dJ          ZY G dK dL          ZZdYdNZ[dYdOZ\dZdPZ]dS )[z"Private logic for creating models.    )annotationsN)ABCMeta)partial)FunctionType)AnyCallableGenericNoReturn)PydanticUndefinedSchemaSerializer)dataclass_transform
deprecated   )PydanticUndefinedAnnotationPydanticUserError)create_schema_validator)GenericBeforeBaseModelWarningPydanticDeprecatedSince20   )ConfigWrapper)DecoratorInfosPydanticDescriptorProxyget_attribute_from_basesunwrap_wrapped_function)collect_model_fieldsis_valid_field_nameis_valid_privateattr_name)GenerateSchema)PydanticGenericMetadataget_model_typevars_map)set_model_mocks)CallbackGetCoreSchemaHandler)generate_pydantic_signature)get_cls_types_namespaceis_annotatedis_classvarparent_frame_namespace)ClassAttributeSafeGetItemProxy)ValidateCallWrapper)Field)	FieldInfoModelPrivateAttr)PrivateAttr	BaseModelc                  $     e Zd ZdZd	 fdZ xZS )
_ModelNamespaceDictz{A dictionary subclass that intercepts attribute setting on model classes and
    warns about overriding of decorators.
    kstrvobjectreturnNonec                    |                      |d           }|r>||ur:t          |t                    r%t          j        d| d|j        j         d           t                                          ||          S )N`z"` overrides an existing Pydantic `z` decorator)	get
isinstancer   warningswarndecorator_infodecorator_reprsuper__setitem__)selfr3   r5   existing	__class__s       X/var/www/html/env/lib/python3.11/site-packages/pydantic/_internal/_model_construction.pyrB   z_ModelNamespaceDict.__setitem__6   s}    D)) 	x))jCZ.[.[)Mvavv8CZCivvvwwwww""1a(((    )r3   r4   r5   r6   r7   r8   )__name__
__module____qualname____doc__rB   __classcell__rE   s   @rF   r2   r2   1   sG         ) ) ) ) ) ) ) ) ) )rG   r2   T)kw_only_defaultfield_specifiersc                       e Zd Z	 	 	 d#d$ fdZej        sd%dZed&d            Zd' fdZ	e
d(d            Ze edd          d)d                         Zd* fd"Z xZS )+ModelMetaclassNTcls_namer4   basestuple[type[Any], ...]	namespacedict[str, Any]__pydantic_generic_metadata__PydanticGenericMetadata | None#__pydantic_reset_parent_namespace__bool_create_model_module
str | Nonekwargsr   r7   typec                
   |r|                      |          \  }}	}
t          j        |||          }|j        |d<   t	          ||j        |	|          }|s|
r(t          ||          d.fd	}||d
<   n
t          |d
<   |	|d<   i |
||d<    t                      j	        | |||fi |}ddl
m} |j        }t          |v rT|                    t                    |                    |          k     r#t          j        t#          d          d           t%          |j        dd           |_        |j        |j        u rdnd
|_        t/          j        |          |_        |r	||_        n?t%          |di                               dd          t%          |dd          prrt9          fdD                       sddlm} t?          fdD                       }|v r<|vr8d                     d |D                       }|j!         d| d|j!         d| d}nm|z   }d                     d  |D                       }d!| d"}d#| d$}t          |vr4d                     d% |D             |gz             }|d&|j!         d'| d(z  }tE          |          ddd)|_        d|_#        |$                                D ]\  }}|%                    ||           |r tM          tO                                |_(        t%          |d*d          }tS          |tT                    rtW          |          }tY          ||          }t[          ||||           |j.        rd+|vrt_          ||           ta          |||d||,           d- |j        j1        $                                D             |_2        tg          |            t          ||          j4        di | |S  t                      j	        | |||fi |S )/a  Metaclass for creating Pydantic models.

        Args:
            cls_name: The name of the class to be created.
            bases: The base classes of the class to be created.
            namespace: The attribute dictionary of the class to be created.
            __pydantic_generic_metadata__: Metadata for generic models.
            __pydantic_reset_parent_namespace__: Reset parent namespace.
            _create_model_module: The module of the class to be created, if created by `create_model`.
            **kwargs: Catch-all for any other keyword arguments.

        Returns:
            The new class created by the metaclass.
        model_configNrC   r0   contextr   r7   r8   c               @    t          | |            | |           dS )zWe need to both initialize private attributes and call the user-defined model_post_init
                        method.
                        N)init_private_attributes)rC   ra   original_model_post_inits     rF   wrapped_model_post_initz7ModelMetaclass.__new__.<locals>.wrapped_model_post_inith   s.     0g>>>00w?????rG   model_post_init__class_vars____private_attributes__r   r/   zClasses should inherit from `BaseModel` before generic classes (e.g. `typing.Generic[T]`) for pydantic generics to work properly.
stacklevel__pydantic_base_init__FrW   
parameters __parameters__c              3      K   | ]}|v V  	d S Nrm   ).0xrl   s     rF   	<genexpr>z)ModelMetaclass.__new__.<locals>.<genexpr>   s(      ?k?kTUZ?k?k?k?k?k?krG   )RootModelRootTypec              3  $   K   | ]
}|v|V  d S rp   rm   )rq   rr   parent_parameterss     rF   rs   z)ModelMetaclass.__new__.<locals>.<genexpr>   s.      .c.cQQbHbHbqHbHbHbHb.c.crG   z, c                    g | ]	}|j         
S rm   rH   rq   rr   s     rF   
<listcomp>z*ModelMetaclass.__new__.<locals>.<listcomp>   s    3[3[3[1AJ3[3[3[rG   zS is a subclass of `RootModel`, but does not include the generic type identifier(s) zL in its parameters. You should parametrize RootModel directly, e.g., `class z(RootModel[z	]): ...`.c                ,    g | ]}t          |          S rm   )r4   ry   s     rF   rz   z*ModelMetaclass.__new__.<locals>.<listcomp>   s    3X3X3XqCFF3X3X3XrG   ztyping.Generic[]zJAll parameters must be present on typing.Generic; you should inherit from .c                    g | ]	}|j         
S rm   rx   ry   s     rF   rz   z*ModelMetaclass.__new__.<locals>.<listcomp>   s    2M2M2M!1:2M2M2MrG   z- Note: `typing.Generic` must go last: `class (z): ...`))originargsrl   __pydantic_parent_namespace____hash__)raise_errorstypes_namespacecreate_model_modulec                $    i | ]\  }}||j         S rm   )info)rq   r3   r5   s      rF   
<dictcomp>z*ModelMetaclass.__new__.<locals>.<dictcomp>   s     (s(s(stq!AF(s(s(srG   rC   r0   ra   r   r7   r8   )5_collect_bases_datar   	for_modelconfig_dictinspect_namespaceignored_typesget_model_post_initrc   rA   __new__mainr0   __mro__r	   indexr=   r>   r   getattr__init____pydantic_custom_init__rf   __pydantic_post_init__r   build__pydantic_decorators__rW   r;   all
root_modelrt   tuplejoinrH   	TypeError__pydantic_complete__items__set_name__build_lenient_weakvaluedictr'   r   r<   dictunpack_lenient_weakvaluedictr$   set_model_fieldsfrozenset_default_hash_funccomplete_model_classcomputed_fieldsmodel_computed_fieldsset_deprecated_descriptors__pydantic_init_subclass__) mcsrR   rS   rU   rW   rY   r[   r]   base_field_names
class_varsbase_private_attributesconfig_wrapperprivate_attributesre   clsr0   mrort   missing_parametersparameters_strerror_messagecombined_parametersgeneric_type_label	bases_strnameobjparent_namespacer   rd   rl   rv   rE   s                                @@@rF   r   zModelMetaclass.__new__@   s   6  H	NDGD[D[\aDbDbAj*A*4UIvNNN(6(BIn%!2>7EU" " " K%< K+>y%+P+P(+7@ @ @ @ @ @ 4KI/003JI/0*4I&'2c5L2cPb2cI./#2577?3%#]#]V\#]#]C((((((+C#~~#))G"4"4syy7K7K"K"K1B   !    07s|E]_d/e/e+eC(141D	Ha1a1agxC&*8*>s*C*CC' - .4Q11$+C1PRT$U$U$Y$YZfhj$k$k!$S*:DAAVEV
 #3"3 #3C?k?k?k?kYj?k?k?k<k<k #3>>>>>>)..c.c.c.c*.c.c.c)c)c&(,===BS[eBeBe *.3[3[HZ3[3[3[)\)\"| J J-J JWZWcJ Jp~J J J & /@BT.T+)-3X3XDW3X3X3X)Y)Y-P~-P-P-P*N8JN N N & #%//
 )-		2M2Mu2M2M2MQcPd2d(e(eI) rPSP\ r r_h r r rM $M222 #",5 51 ).C% 05577 , ,	c  d++++2 j4OPfPhPh4i4i1&s,KTRR*D11 R#?@P#Q#Q 5c;KLLOS%III$ 29)D)D%c5111 " /$8    )t(ss?Z?j?p?p?r?r(s(s(sC%&s+++
 7E#sOO6@@@@@J #577?3%MMfMMMrG   itemc                p    | j                             d          }|r||v r||         S t          |          )zNThis is necessary to keep attribute access working for class attribute access.rh   )__dict__r;   AttributeError)rC   r   r   s      rF   __getattr__zModelMetaclass.__getattr__   sE    !%!2!23K!L!L! 0d.@&@&@)$// &&&rG   r   dict[str, object]c                    t                      S rp   )r2   )r   r   r]   s      rF   __prepare__zModelMetaclass.__prepare__   s    "$$$rG   instancec                f    t          |d          o t                                          |          S )zsAvoid calling ABC _abc_subclasscheck unless we're pretty sure.

        See #3829 and python/cpython#92810
        __pydantic_validator__)hasattrrA   __instancecheck__)rC   r   rE   s     rF   r   z ModelMetaclass.__instancecheck__   s.    
 x!9::buww?X?XYa?b?bbrG   6tuple[set[str], set[str], dict[str, ModelPrivateAttr]]c                Z   ddl m} t                      }t                      }i }| D ]}t          ||          rn||urj|                    t          |di                                                      |                    |j                   |                    |j                   |||fS )Nr   r/   model_fields)	r   r0   set
issubclassupdater   keysrg   rh   )rS   r0   field_namesr   r   bases         rF   r   z"ModelMetaclass._collect_bases_data   s    $$$$$$ #"uu
:< 	G 	GD$	** Gt9/D/D""74#D#D#I#I#K#KLLL!!$"5666"))$*EFFFJ(:::rG   EThe `__fields__` attribute is deprecated, use `model_fields` instead.)categorydict[str, FieldInfo]c                D    t          j        dt                     | j        S )Nr   )r=   r>   r   r   rC   s    rF   
__fields__zModelMetaclass.__fields__	  s)     	SUn	
 	
 	
   rG   	list[str]c                    t          t                                                                }d|v r|                    d           |S )Nr   )listrA   __dir__remove)rC   
attributesrE   s     rF   r   zModelMetaclass.__dir__  sC    %''//++,,
:%%l+++rG   )NTN)rR   r4   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r   r7   r^   )r   r4   r7   r   )r   r   r]   r   r7   r   )r   r   r7   rZ   )rS   rT   r7   r   )r7   r   )r7   r   )rH   rI   rJ   r   typingTYPE_CHECKINGr   classmethodr   r   staticmethodr   propertyr   r   r   rL   rM   s   @rF   rQ   rQ   >   s>        IM48+/cN cN cN cN cN cN cNJ  '	' 	' 	' 	' % % % [%c c c c c c ; ; ; \; ZWbfggg! ! ! hg X!         rG   rQ   rC   r0   ra   r   r7   r8   c                   t          | dd          Vi }| j                                        D ]'\  }}|                                }|t          ur|||<   (t          | d|           dS dS )a  This function is meant to behave like a BaseModel method to initialise private attributes.

    It takes context as an argument since that's what pydantic-core passes when calling it.

    Args:
        self: The BaseModel instance.
        context: The context.
    __pydantic_private__N)r   rh   r   get_defaultr   object_setattr)rC   ra   pydantic_privater   private_attrdefaults         rF   rc   rc     s     t+T22:"&"="C"C"E"E 	1 	1D,"..00G///)0 &t35EFFFFF ;:rG   rU   rV   rS   rT   Callable[..., Any] | Nonec                `    d| v r| d         S ddl m} t          |d          }||j        ur|S dS )zaGet the `model_post_init` method from the namespace or the class bases, or `None` if not defined.rf   r   r/   N)r   r0   r   rf   )rU   rS   r0   rf   s       rF   r   r   *  sW    I%%*++      .u6GHHOi777 87rG   r   base_class_varsset[str]base_class_fieldsdict[str, ModelPrivateAttr]c           
     Z   ddl m}mm} |t	                      z   }i }|                     di           }d|v sd| v rt          d          t                      }	t          | 	                                          D ]\  }
}|
dk    s|
dk    rt          |t                    r6|j        | d         k    r%d	| v r!|j                            | d	                   r^t          ||          s|j        j        d
k    r|	                    |
           t          |          rY|
                    d          rt#          d|
d          t%          |
          rt#          dd|
z   d|
d          |||
<   | |
= t          ||          r<t%          |
          s-|
                    d          pd}t#          d|d|
d          |
                    d          r`t)          |
          r-|
|vst+          ||
                   s ||          ||
<   | |
= |
|v r|
|vrY|
|v rt-          d|
dd          t          ||          rt-          d|
dd          t-          d|
 d|d|
 dd          |	                                D ]\  }}t)          |          r||vr||	vr~t+          |          so||vrkt/          |dd          d
k    rVt1          |          r:t3          j        |          ^}}t7          fd|D             d          }||||<    |            ||<   |S ) a  Iterate over the namespace and:
    * gather private attributes
    * check for items which look like fields but are not (e.g. have no annotation) and warn.

    Args:
        namespace: The attribute dictionary of the class to be created.
        ignored_types: A tuple of ignore types.
        base_class_vars: A set of base class class variables.
        base_class_fields: A set of base class fields.

    Returns:
        A dict contains private attributes info.

    Raises:
        TypeError: If there is a `__root__` field in model.
        NameError: If private attribute name is invalid.
        PydanticUserError:
            - If a field does not have a type annotation.
            - If a field on base class was overridden by a non-annotated attribute.
    r   )r,   r-   r.   __annotations____root__zUTo define root models, use `pydantic.RootModel` rather than a field called '__root__'r`   __pydantic_extra__rI   rJ   	functools__zXPrivate attributes must not use dunder names; use a single underscore prefix instead of r}   zJPrivate attributes must not use valid field names; use sunder names, e.g. _z instead of my_fieldz>Fields must not use names with leading underscores; e.g., use )r   zField z defined on a base class was overridden by a non-annotated attribute. All field definitions, including overrides, require a type annotation.zmodel-field-overridden)codez requires a type annotationzmodel-field-missing-annotationz)A non-annotated attribute was detected: `z = z3`. All model fields require a type annotation; if `z` is not meant to be a field, you may be able to resolve this error by annotating it as a `ClassVar` or updating `model_config['ignored_types']`.Nc              3  <   K   | ]}t          |          |V  d S rp   )r<   )rq   r5   r-   s     rF   rs   z$inspect_namespace.<locals>.<genexpr>  s3      $\$\1JqJZ<[<[$\Q$\$\$\$\$\$\rG   )fieldsr,   r-   r.   default_ignored_typesr;   r   r   r   r   r<   r^   rI   rJ   
startswithrE   add	NameErrorr   lstripr   r&   r   r   r%   typing_extensionsget_argsnext)rU   r   r   r   r,   r.   all_ignored_typesr   raw_annotationsignored_namesvar_namevaluesuggested_nameann_nameann_typer   metadatar   r-   s                     @rF   r   r   6  s   4 BAAAAAAAAA%(=(?(??68mm$5r::O_$$
i(?(?oppp!eeM	 1 122 ; ;%~%%5I)I)Iud##8	 Il$;;;)++"--i.GHH , 011 0	U_5OS^5^5^h'''/00 -	""4(( 	PBJP P P   %X.. [/2X~[ [MU[ [ [   ,1x((##y))  	2Eh2O2O  	%__S11?ZNJ,J J<DJ J J  
   && 	&x00 	..k/RZB[6\6\./:{5/I/I/I"8,h'((_,,,,,'^X ^ ^ ^1   
 E9-- 
'DXDDDKk    (k k kU k k,4k k k :	    -& .3355 9 9(%h//	9 222--)) . 111,55DDH%% 09(CCH#$\$\$\$\$\$\$\^bcc+3?&x0+6;==x(rG   r   type[BaseModel]c                    t          |d          }t          |           }|d t          j        hv st	          |dd           |j        k    r	|| _        d S d S )Nr   __code__)r   make_hash_funcr6   r   r   r  )r   rS   base_hash_funcnew_hash_funcs       rF   r   r     sa    -eZ@@N"3''M$000GNJX\4]4]anaw4w4w % 5x4wrG   c                r    | j         r%t          j        | j                                          nd dfd}|S )Nc                    dS )Nr   rm   )r   s    rF   <lambda>z make_hash_func.<locals>.<lambda>  s    ^_ rG   rC   r   r7   intc                    	 t           | j                            S # t          $ r- t           t          | j                                      cY S w xY wrp   )hashr   KeyErrorr)   )rC   getters    rF   	hash_funcz!make_hash_func.<locals>.hash_func  sm    	At}--... 	A 	A 	A
 />>??@@@@@	As     4AA)rC   r   r7   r  )r   operator
itemgetterr   )r   r  r  s     @rF   r  r    s\    >A>N_X #"2"7"7"9"9::T_T_FA A A A A A rG   r   r   r   c                    t          |           }t          | ||||          \  }}|| _        | j                            |           |D ]C}| j                            |d          }|$|j        t          urt          | ||j                   DdS )a.  Collect and set `cls.model_fields` and `cls.__class_vars__`.

    Args:
        cls: BaseModel or dataclass.
        bases: Parents of the class, generally `cls.__bases__`.
        config_wrapper: The config wrapper instance.
        types_namespace: Optional extra namespace to look for types in.
    )typevars_mapN)
r    r   r   rg   r   rh   popr   r   setattr)	r   rS   r   r   r!  r   r   r3   r
  s	            rF   r   r     s     *#..L-c5./htuuuFJCj))) 
+ 
+ *..q$776G!G!GCEM***
+ 
+rG   )r   r   rR   r4   r   rZ   dict[str, Any] | Noner   r\   c          	        t          |           }t          |||          }t          t          |j        d          |d          }|j        rd|j        v rt          | |           dS 	 |                     | |          }	n5# t          $ r(}
|r t          | |d|
j
         d           Y d}
~
dS d}
~
ww xY w|                    |           }	 |                    |	          }	n!# |j        $ r t          | |           Y dS w xY w|	| _        t          |	| |p| j        | j        |rdnd	||j                  | _        t)          |	|          | _        d
| _        t/          dt1          | j        | j        |                    | _        d
S )a  Finish building a model class.

    This logic must be called after class has been created since validation functions must be bound
    and `get_type_hints` requires a class object.

    Args:
        cls: BaseModel or dataclass.
        cls_name: The model or dataclass name.
        config_wrapper: The config wrapper instance.
        raise_errors: Whether to raise errors.
        types_namespace: Optional extra namespace to look for types in.
        create_model_module: The module of the class to be created, if created by `create_model`.

    Returns:
        `True` if the model is successfully completed, else `False`.

    Raises:
        PydanticUndefinedAnnotation: If `PydanticUndefinedAnnotation` occurs in`__get_pydantic_core_schema__`
            and `raise_errors=True`.
    F)from_dunder_get_core_schemaunpack)ref_modemodelr:   Ncreate_modelr0   T__signature__)initr   r   )r    r   r"   r   generate_schemadefer_buildexperimental_defer_build_moder!   __get_pydantic_core_schema__r   r   core_configclean_schemaCollectedInvalid__pydantic_core_schema__r   rI   rJ   plugin_settingsr   r   __pydantic_serializer__r   r(   r#   r   r   r+  )r   rR   r   r   r   r   r!  
gen_schemahandlerschemaer1  s               rF   r   r     s   : *#..L J +
*NNN  G ! g1]&]&]X&&&u11#w??&    	X}16}}}555uuuuu	 !,,S11K((00&   X&&&uu
 $*C !8-s~->;&" "C #36;"G"GC $C '#c>N_mnnn C 4s*   *B 
B3B..B3C" "D ?D c                   | j                                         D ]D\  }}|j        x}6t          |          }|                    | |           t          | ||           E| j                                        D ]l\  }}|j        x}^t          t          |j	                  d          s<t          ||j	                  }|                    | |           t          | ||           mdS )z8Set data descriptors on the class for deprecated fields.N__deprecated__)
r   r   deprecation_message_DeprecatedFieldDescriptorr   r#  r   r   r   wrapped_property)r   field
field_infomsgdesccomputed_field_infos         rF   r   r   <  s    -3355 & &z11C>-c22Dc5)))C%%%&)&?&E&E&G&G & &""';;SH34G4XYY[kll I .c3F3WXXDc5)))C%%%& &rG   c                  B    e Zd ZU dZded<   ddd
ZddZdddZddZdS )r>  aM  Data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.

    Attributes:
        msg: The deprecation message to be emitted.
        wrapped_property: The property instance if the deprecated field is a computed field, or `None`.
        field_name: The name of the field being deprecated.
    r4   
field_nameNrB  r?  property | Noner7   r8   c                "    || _         || _        d S rp   )rB  r?  )rC   rB  r?  s      rF   r   z#_DeprecatedFieldDescriptor.__init__Z  s     0rG   r   r  r   c                    || _         d S rp   )rF  )rC   r   r   s      rF   r   z'_DeprecatedFieldDescriptor.__set_name__^  s    rG   r   BaseModel | Noneobj_typetype[BaseModel] | Noner   c                    |t          | j                  t          j        | j        t
          j        d           | j        | j                            ||          S |j	        | j                 S )Nr   ri   )
r   rF  r=   r>   rB  builtinsDeprecationWarningr?  __get__r   )rC   r   rK  s      rF   rP  z"_DeprecatedFieldDescriptor.__get__a  sd    ; 111dh ;JJJJ ,(00h???|DO,,rG   r
  r
   c                *    t          | j                  rp   )r   rF  )rC   r   r
  s      rF   __set__z"_DeprecatedFieldDescriptor.__set__n  s    T_---rG   rp   )rB  r4   r?  rG  r7   r8   )r   r  r   r4   r7   r8   )r   rJ  rK  rL  r7   r   )r   r   r
  r   r7   r
   )	rH   rI   rJ   rK   r   r   r   rP  rR  rm   rG   rF   r>  r>  O  s           OOO1 1 1 1 1   - - - - -. . . . . .rG   r>  c                  *    e Zd ZdZd
dZddZddZd	S )_PydanticWeakRefa  Wrapper for `weakref.ref` that enables `pickle` serialization.

    Cloudpickle fails to serialize `weakref.ref` objects due to an arcane error related
    to abstract base classes (`abc.ABC`). This class works around the issue by wrapping
    `weakref.ref` instead of subclassing it.

    See https://github.com/pydantic/pydantic/issues/6763 for context.

    Semantics:
        - If not pickled, behaves the same as a `weakref.ref`.
        - If pickled along with the referenced object, the same `weakref.ref` behavior
          will be maintained between them after unpickling.
        - If pickled without the referenced object, after unpickling the underlying
          reference will be cleared (`__call__` will always return `None`).
    r   r   c                N    |	d | _         d S t          j        |          | _         d S rp   )_wrweakrefref)rC   r   s     rF   r   z_PydanticWeakRef.__init__  s)    ; DHHH{3''DHHHrG   r7   c                <    | j         d S |                                  S rp   )rV  r   s    rF   __call__z_PydanticWeakRef.__call__  s    8488::rG   4tuple[Callable, tuple[weakref.ReferenceType | None]]c                &    t            |             ffS rp   )rT  r   s    rF   
__reduce__z_PydanticWeakRef.__reduce__  s    $$&&**rG   N)r   r   )r7   r   )r7   r[  )rH   rI   rJ   rK   r   rZ  r]  rm   rG   rF   rT  rT  r  sZ          ( ( ( (   + + + + + +rG   rT  dc                    | dS i }|                                  D ]-\  }}	 t          |          }n# t          $ r |}Y nw xY w|||<   .|S )aX  Takes an input dictionary, and produces a new value that (invertibly) replaces the values with weakrefs.

    We can't just use a WeakValueDictionary because many types (including int, str, etc.) can't be stored as values
    in a WeakValueDictionary.

    The `unpack_lenient_weakvaluedict` function can be used to reverse this operation.
    N)r   rT  r   )r^  resultr3   r5   proxys        rF   r   r     sv     	ytF		  1	$Q''EE 	 	 	EEE	q		Ms   1A A c                    | dS i }|                                  D ]1\  }}t          |t                    r |            }||||<   ,|||<   2|S )zAInverts the transform performed by `build_lenient_weakvaluedict`.N)r   r<   rT  )r^  r`  r3   r5   s       rF   r   r     si    ytF		  1a)** 	A}q	F1IIMrG   c                 \    ddl m}  t          t          t          t
          t          | t          fS )Nr   ComputedFieldInfo)r   re  r   r   r   r   r   r*   rd  s    rF   r   r     s5    ****** 	 rG   r   )rU   rV   rS   rT   r7   r   )
rU   rV   r   rT   r   r   r   r   r7   r   )r   r  rS   rT   r7   r8   )r   r  r7   r   )
r   r  rS   rT   r   r   r   rV   r7   r8   )r   r  rR   r4   r   r   r   rZ   r   r$  r   r\   r7   rZ   )r   r  r7   r8   )r^  r$  r7   r$  )r7   rT   )^rK   
__future__r   _annotationsrN  r  r   r=   rW  abcr   r   r   typesr   r   r   r	   r
   r  pydantic_corer   r   r   r   errorsr   r   plugin._schema_validatorr   r   r   _configr   _decoratorsr   r   r   r   _fieldsr   r   r   _generate_schemar   	_genericsr   r    _mock_val_serr!   _schema_generation_sharedr"   
_signaturer#   _typing_extrar$   r%   r&   r'   _utilsr(   r)   _validate_callr*   r   r   r+   PydanticModelFieldr,   r-   r.   PydanticModelPrivateAttrr   r0   rO  r6   __setattr__r   r   r2   rQ   rc   r   r   r   r  r   r   r   r>  rT  r   r   r   rm   rG   rF   <module>r{     s   ( ( 2 2 2 2 2 2                        3 3 3 3 3 3 3 3 3 3 3 3     = = = = = = = = = = = = = = = = C C C C C C C C > > > > > > O O O O O O O O " " " " " " s s s s s s s s s s s s Y Y Y Y Y Y Y Y Y Y , , , , , , F F F F F F F F * * * * * * C C C C C C 3 3 3 3 3 3 e e e e e e e e e e e e 4 4 4 4 4 4 4 4 / / / / / /	 
(44444444444444@@@@@@        3%vxx#
) 
) 
) 
) 
)$ 
) 
) 
) T=OQi<jkkkV V V V VW V V lkVrG G G G$	 	 	 	s s s sl
% 
% 
% 
%    + + + +F &*R R R R R Rj& & & && .  .  .  .  .  .  .  .F +  +  +  +  +  +  +  +F   (         rG   