
    g                       S r SSKJr  SSKrSSKrSSK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  SSKJr  SSK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JrJr  S
SKJ r J!r!  S
SK"J#r#  S
SKJ$r$J%r%  SSK&J'r'  SSK(J)r)J*r*J+r+J,r,  SSK-J.r.J/r/J0r0  SSK1J2r2  SSK3J4r4J5r5  SSK6J7r7J8r8  SSK9J:r:  SSK;J<r<  SSK=J>r>  SSK?J@r@  SSKAJBrBJCrCJDrDJErEJFrF  SSKGJHrHJIrI  \R                  (       a  S
SKKJLrLJMrMJNrN  S
SKKJOrP  S
SKKJQrR  S
SKSJTrT  O\%rU\V" 5       rP\V" 5       rR\VR                  rX " S S \Y5      rZS!S".   S9S# jjr[\" S$\P\R\[4S%9 " S& S'\5      5       r\S:S( jr]S;S) jr^          S<S* jr_S=S+ jr`S>S, jra          S?S- jrbS$SSS..             S@S/ jjrcSAS0 jrd " S1 S25      re " S3 S45      rfSBS5 jrgSBS6 jrh\" SS79SCS8 j5       rig)Dz"Private logic for creating models.    )annotationsN)ABCMeta)	lru_cachepartial)FunctionType)AnyCallableGenericLiteralNoReturncast)PydanticUndefinedSchemaSerializer)TypeAliasTypedataclass_transform
deprecatedget_args   )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)import_cached_base_modelimport_cached_field_info)set_model_mocks)
NsResolver)CallbackGetCoreSchemaHandler)generate_pydantic_signature)_make_forward_refeval_type_backportis_annotatedis_classvar_annotationparent_frame_namespace)LazyClassAttributeSafeGetItemProxy)ComputedFieldInfo	FieldInfoModelPrivateAttr)Field)PrivateAttr)	BaseModelc                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )_ModelNamespaceDict8   zsA dictionary subclass that intercepts attribute setting on model classes and
warns about overriding of decorators.
c                   > U R                  US 5      nU(       aJ  X#LaF  [        U[        5      (       a1  [        R                  " SU SUR
                  R                   S35        [        TU ]!  X5      $ )N`z"` overrides an existing Pydantic `z` decorator)	get
isinstancer   warningswarndecorator_infodecorator_reprsuper__setitem__)selfkvexisting	__class__s       _/home/matz/Project1/venv/lib/python3.13/site-packages/pydantic/_internal/_model_construction.pyrE   _ModelNamespaceDict.__setitem__=   sb    D))jCZ.[.[MMAaS B8CZCZCiCiBjjuvww"1((     )rG   strrH   objectreturnNone)__name__
__module____qualname____firstlineno____doc__rE   __static_attributes____classcell__rJ   s   @rK   r:   r:   8   s    ) )rM   r:   Finitc                    g)zOnly for typing purposes. Used as default value of `__pydantic_fields_set__`,
`__pydantic_extra__`, `__pydantic_private__`, so they could be ignored when
synthesizing the `__init__` signature.
NrN   r[   s    rK   NoInitFieldr^   E   s    rM   T)kw_only_defaultfield_specifiersc                    ^  \ rS rSr   S               SU 4S jjjr\R                  (       d  SS jr\SS j5       r	SU 4S jjr
\SS j5       r\\" SSS	9SS
 j5       5       r\SS j5       r\SS j5       rSU 4S jjrSrU =r$ )ModelMetaclassO   Nc           	     	  >^ ^!^" U(       Ga  U R                  U5      u  pn
[        R                  " X#U5      nUR                  US'   [	        X;R
                  X5      nU(       d  U
(       a$  [        X25      m T b  S'U 4S jjnXS'   O	[        US'   XS'   0 U
EUEUS'   [        S[        T#U ](  " XX#40 UD65      n[        5       nUR                  n[        U;   aF  UR                  [        5      UR                  U5      :  a  [        R                   " [#        S5      S	S
9  [%        UR&                  SS5      (       + Ul        UR*                  UR*                  L a  SOSUl        [.        R0                  " U5      Ul        U(       a  XNl        GOv[%        US0 5      R7                  SS5      m"[%        USS5      =(       d    T"m!T!(       Ga0  T"(       Ga(  [9        U!4S jT" 5       5      (       Gd  S	SKJn  [?        U"4S jT! 5       5      nUT";   aU  UT!;  aO  SRA                  U Vs/ s H  nURB                  PM     sn5      nURB                   SU SURB                   SU S3nOT"U-   nSRA                  U Vs/ s H  n[E        U5      PM     sn5      nSU S3nSU S3n[        U;  aF  SRA                  U Vs/ s H  nURB                  PM     snU/-   5      nUSURB                   SU S3-  n[G        U5      eSST!S .Ul        SUl$        URK                  5        H  u  nnURM                  UU5        M     U(       a  [O        [Q        5       5      Ul)        [%        US!S5      n[U        U[V        5      (       a  [Y        U5      n[[        US"9n[]        XUU5        UR^                  (       a  S#U;  a  [a        X5        [c        UUUSUUS$9  UR2                  Rd                  RK                  5        VVs0 s H  u  nnUURf                  _M     snnUl4        [k        U5        [        X]  " S0 UD6  U$ S% H  nURo                  US5        M     UR7                  S&0 5      Rq                  5         [        T#U ](  " XX#40 UD6$ s  snf s  snf s  snf s  snnf )(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_configNc               ,   > [        X5        T" X5        g)z`We need to both initialize private attributes and call the user-defined model_post_init
method.
N)init_private_attributes)rF   contextoriginal_model_post_inits     rK   wrapped_model_post_init7ModelMetaclass.__new__.<locals>.wrapped_model_post_inity   s     0>0?rM   model_post_init__class_vars____private_attributes__type[BaseModel]zClasses should inherit from `BaseModel` before generic classes (e.g. `typing.Generic[T]`) for pydantic generics to work properly.r   
stacklevel__pydantic_base_init__F__pydantic_generic_metadata__
parametersrN   __parameters__c              3  ,   >#    U  H	  oT;   v   M     g 7fNrN   ).0xrt   s     rK   	<genexpr>)ModelMetaclass.__new__.<locals>.<genexpr>   s     ?kYjTUZYjs   )RootModelRootTypec              3  6   >#    U  H  oT;  d  M
  Uv   M     g 7frw   rN   )rx   ry   parent_parameterss     rK   rz   r{      s     .c*QQbHbqq*s   		z, 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	]): ...`.ztyping.Generic[]zJAll parameters must be present on typing.Generic; you should inherit from .z- Note: `typing.Generic` must go last: `class (z): ...`))originargsrt   __pydantic_parent_namespace__)parent_namespace__hash__raise_errorsns_resolvercreate_model_module)__pydantic_fields_set____pydantic_extra____pydantic_private____annotations__rF   r8   rh   r   rQ   rR   )9_collect_bases_datar   	for_modelconfig_dictinspect_namespaceignored_typesget_model_post_initrg   r   rD   __new__r&   __mro__r
   indexr@   rA   r   getattr__init____pydantic_custom_init__rl   __pydantic_post_init__r   build__pydantic_decorators__rs   r>   all
root_modelr|   tuplejoinrS   rO   	TypeError__pydantic_complete__items__set_name__build_lenient_weakvaluedictr0   r   r?   dictunpack_lenient_weakvaluedictr)   set_model_fieldsfrozenset_default_hash_funccomplete_model_classcomputed_fieldsinfo__pydantic_computed_fields__set_deprecated_descriptors__pydantic_init_subclass__popclear)$mcscls_namebases	namespacers   #__pydantic_reset_parent_namespace___create_model_modulekwargsbase_field_names
class_varsbase_private_attributesconfig_wrapperprivate_attributesrj   cls
BaseModel_mror|   missing_parametersry   parameters_strerror_messagecombined_parametersgeneric_type_label	bases_strnameobjr   r   rG   rH   instance_slotri   rt   r~   rJ   s$                                   @@@rK   r   ModelMetaclass.__new__Q   s   6 DGD[D[\aDbA*A*44UvNN(6(B(BIn%!277" "%<+>y+P(+7@ 4K/03JI/0*4&'2c5L2cPb2cI./(%'/#*d]c*deC13J++C#~#))G"4syy7L"L1B  ! 07s||E]_d/e+eC(++z/I/IIO` & +9*>*>s*CC' -4Q1$+C1PRT$U$Y$YZfhj$k!$S*:DAVEV
"3C?kYj?k<k<k>)..c*.c)c&(,==BS[eBe *.HZ3[HZ1AJJHZ3[)\"||n,-. /WWZWcWcVddop~o  @IJ & /@BT.T+)-DW3XDWqCFDW3X)Y/>~>Na-P*88J7K1N & #%/
 )-		u2Mu!1::u2MQcPd2d(eI)"OPSP\P\~]^_h^iiq rM $M22 #",51 ).C% 0557	c  d+ 8 34OPfPh4i16=cCbdh6i*D11#?@P#Q $6FGKSE$$9)D%c1 "'$8 '*&A&A&Q&Q&W&W&Y0&Yda166	&Y0C, 's+
 #6@@J "i! "i
 MM+R06687?3%MfMMc 4\ 4Y 3NV0s   Q93Q>4R-Rc                n    U R                   R                  S5      nU(       a	  X;   a  X!   $ [        U5      e)zNThis is necessary to keep attribute access working for class attribute access.rn   )__dict__r>   AttributeError)rF   itemr   s      rK   __getattr__ModelMetaclass.__getattr__  s4    !%!2!23K!L!d&@)// &&rM   c                    [        5       $ rw   )r:   )r   r   r   s      rK   __prepare__ModelMetaclass.__prepare__
  s    "$$rM   c                H   > [        US5      =(       a    [        TU ]	  U5      $ )zcAvoid calling ABC _abc_subclasscheck unless we're pretty sure.

See #3829 and python/cpython#92810
__pydantic_validator__)hasattrrD   __instancecheck__)rF   instancerJ   s     rK   r    ModelMetaclass.__instancecheck__  s#    
 x!9:buw?XYa?bbrM   c                L   [        5       n[        5       n[        5       n0 nU  H{  n[        XQ5      (       d  M  XQLd  M  UR                  [	        US0 5      R                  5       5        UR                  UR                  5        UR                  UR                  5        M}     X#U4$ )N__pydantic_fields__)r&   set
issubclassupdater   keysrm   rn   )r   r8   field_namesr   r   bases         rK   r   "ModelMetaclass._collect_bases_data  s    ,.	 #"u
:<D$**t/D""741F#K#P#P#RS!!$"5"56"))$*E*EF  (:::rM   EThe `__fields__` attribute is deprecated, use `model_fields` instead.)categoryc                N    [         R                  " S[        SS9  U R                  $ )Nr   r   rp   )r@   rA   r   model_fieldsrF   s    rK   
__fields__ModelMetaclass.__fields__$  s'     	S%	

    rM   c                    [        U S0 5      $ )zGet metadata about the fields defined on the model.

Returns:
    A mapping of field names to [`FieldInfo`][pydantic.fields.FieldInfo] objects.
r   r   r   s    rK   r   ModelMetaclass.model_fields.  s     t2B77rM   c                    [        U S0 5      $ )zGet metadata about the computed fields defined on the model.

Returns:
    A mapping of computed field names to [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects.
r   r   r   s    rK   model_computed_fields$ModelMetaclass.model_computed_fields7  s     t;R@@rM   c                d   > [        [        TU ]	  5       5      nSU;   a  UR                  S5        U$ )Nr   )listrD   __dir__remove)rF   
attributesrJ   s     rK   r   ModelMetaclass.__dir__@  s0    %'/+,
:%l+rM   rN   )NTN)r   rO   r   tuple[type[Any], ...]r   dict[str, Any]rs   zPydanticGenericMetadata | Noner   boolr   
str | Noner   r   rQ   type)r   rO   rQ   r   )r   r   r   r   rQ   zdict[str, object])r   r   rQ   r   )r   r   rQ   z6tuple[set[str], set[str], dict[str, ModelPrivateAttr]])rQ   zdict[str, FieldInfo])rQ   zdict[str, ComputedFieldInfo])rQ   z	list[str])rS   rT   rU   rV   r   typingTYPE_CHECKINGr   classmethodr   r   staticmethodr   propertyr   r   r   r   r   rX   rY   rZ   s   @rK   rb   rb   O   s    IM48+/mNmN %mN "	mN
 (FmN .2mN )mN mN 
mN mN^ 	' % %c ; ; Wbfg! h ! 8 8 A A rM   rb   c                   [        U SS5      cR  0 nU R                  R                  5        H$  u  p4UR                  5       nU[        Ld  M   XRU'   M&     [        U SU5        gg)zThis 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.
r   N)r   rn   r   get_defaultr   object_setattr)rF   rh   pydantic_privater   private_attrdefaults         rK   rg   rg   G  sk     t+T2:"&"="="C"C"ED"..0G//)0& #F 	t35EF ;rM   c                f    SU ;   a  U S   $ [        5       n[        US5      nX2R                  La  U$ g)zaGet the `model_post_init` method from the namespace or the class bases, or `None` if not defined.rl   N)r&   r   rl   )r   r   r8   rl   s       rK   r   r   Y  sB    I%*++(*I.u6GHO777 8rM   c           
     *  ^ SSK JmJn  [        5       nU[	        5       -   n0 nU R                  S0 5      nSU;   d  SU ;   a  [        S5      e[        5       n	[        U R                  5       5       GH  u  pU
S:X  d  U
S:X  a  M  [        U[        5      (       a>  UR                  U S   :X  a+  S	U ;   a%  UR                  R                  U S	   5      (       a  Mg  [        X5      (       d  UR                  R                  S
:X  a  U	R!                  U
5        M  [        UT5      (       aV  U
R                  S5      (       a  [#        SU
< S35      e[%        U
5      (       a  [#        SSU
-   < SU
< S35      eXU
'   X
	 GM  [        X5      (       a>  [%        U
5      (       d.  U
R'                  S5      =(       d    Sn[#        SU< SU
< S35      eU
R                  S5      (       a  GMr  [)        U
5      (       a1  X;  d  [+        X   5      (       d  [-        TU" US95      Xz'   X
	 GM  GM  X;   a  GM  X;  d  GM  X;   a  [/        SU
< S3SS9e[        X5      (       a  [/        SU
< S3SS9e[/        SU
 SU< SU
 S3SS9e   UR                  5        H  u  p[)        U5      (       d  M  X;  d  M  X;  d  M%  [+        U5      (       a  M7  X;  d  M>  [1        USS5      S
:w  d  MQ  [        U[2        5      (       aB  [4        R6                  " S5      nUb)   [9        [;        USS S!9UR<                  UR>                  S"9n[A        U5      (       a,  [C        U5      tnn[E        U4S# jU 5       S5      nUb  UX}'   M  U" 5       X}'   M     U$ ! ["        [        4 a     N]f = f)$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   )r5   r7   r   __root__zUTo define root models, use `pydantic.RootModel` rather than a field called '__root__'re   r   rT   rU   	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']`.NFT)is_argumentis_class)globalnslocalnsc              3  N   >#    U  H  n[        UT5      (       d  M  Uv   M     g 7frw   )r?   )rx   rH   r5   s     rK   rz   $inspect_namespace.<locals>.<genexpr>  s     $\1JqJZ<[QQs   %	%)#fieldsr5   r7   r'   default_ignored_typesr>   r   r   r   r   r?   r   rT   rU   
startswithrJ   add	NameErrorr!   lstripr"   r/   r   r   r   rO   sys	_getframer-   r,   	f_globalsf_localsr.   r   next)r   r   base_class_varsbase_class_fieldsr7   r4   all_ignored_typesr   raw_annotationsignored_namesvar_namevaluesuggested_nameann_nameann_typeframer  metadatar  r5   s                      @rK   r   r   e  s   4 7(*I%(=(??68mm$5r:O_$
i(?opp!eM	 12~%5I)Iud##  Il$;;)+""--i.GHH 11U__5O5OS^5^h'/00""4((BBJQP  %X..//2X~.@XLXY[  ,1x(#))2Eh2O2O%__S1?ZN,/|H<qJ 
   &&&x00.6L_Mf6g6g/34DkZ_F`/a",' 7h (,,'XL )] ^1 
 E--'XL(CDKk  (?zUI V,,4: 6jk :	 m 3z .335%h//2- +8441,5D(C(( a($#5-hETXY%*__$)NN$ H%%'1H#$\$\^bc+3?&0+6=(? 6B  &y1 s   (M??NNc                    [        US5      n[        U 5      nUS [        R                  1;   d  [	        USS 5      UR
                  :X  a  X0l        g g )Nr   __code__)r   make_hash_funcrP   r   r   r/  )r   r   base_hash_funcnew_hash_funcs       rK   r   r     sN    -eZ@N"3'M$00GNJX\4]anawaw4w % 5xrM   c                   ^ U R                   (       a+  [        R                  " U R                   R                  5       6 OS mSU4S jjnU$ )Nc                    g)Nr   rN   )r  s    rK   <lambda> make_hash_func.<locals>.<lambda>  s    lmrM   c                   >  [        T" U R                  5      5      $ ! [         a'    [        T" [        U R                  5      5      5      s $ f = frw   )hashr   KeyErrorr2   )rF   getters    rK   	hash_func!make_hash_func.<locals>.hash_func  sJ    	At}}-.. 	A
 />?@@	As    .AA)rF   r   rQ   int)r   operator
itemgetterr   )r   r;  r:  s     @rK   r0  r0    s;    EHE\E\X  #"9"9">">"@AbmFA rM   c                    [        U 5      n[        XX#US9u  pVXPl        U R                  R	                  U5        U HO  nU R
                  R                  US5      nUc  M$  UR                  [        Ld  M9  [        XUR                  5        MQ     g)a$  Collect and set `cls.__pydantic_fields__` and `cls.__class_vars__`.

Args:
    cls: BaseModel or dataclass.
    bases: Parents of the class, generally `cls.__bases__`.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting model annotations.
)typevars_mapN)
r%   r    r   rm   r   rn   r   r  r   setattr)	r   r   r   r   rA  r  r   rG   r(  s	            rK   r   r   
  s~     *#.L-c.dpqF$j) **..q$76G!GCEMM* rM   r   c               ,   UR                   (       a  [        X5        g[        U 5      n[        UUU5      n[	        [        UR                  SS9USS9n U R                  X5      n	UR                  U R                  S9n UR                  U	5      n	Xl        [        U	U U=(       d    U R                   U R"                  U(       a  SOS	UUR$                  5      U l        [)        X5      U l        S
U l        [/        S[        [0        U R2                  U R4                  UR6                  UR8                  S95      U l        g
! [         a,  n
U(       a  e [        XSU
R                   S35         Sn
A
gSn
A
ff = f! UR                   a    [        X5         gf = f)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.
    ns_resolver: The namespace resolver instance to use during schema building.
    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_moder=   N)titlecreate_modelr8   T__signature__)r\   r  populate_by_nameextra)defer_buildr(   r%   r#   r*   r   generate_schema__get_pydantic_core_schema__r   r   core_configrS   clean_schemaCollectedInvalid__pydantic_core_schema__r   rT   rU   plugin_settingsr   r   __pydantic_serializer__r   r1   r+   r   r   rJ  rK  rI  )r   r   r   r   r   r   rA  
gen_schemahandlerschemaerO  s               rK   r   r   +  s   : !!&)#.LJ +
**NG11#? !,,3<<,@K((0 $* !8-s~~-;&&"C #36"GC $C
 +'**+<< &&	
	C U ' 166(!}5	 && &s*   D< ?E5 <
E2"E--E25FFc                   U R                   R                  5        H>  u  pUR                  =nc  M  [        U5      nUR	                  X5        [        XU5        M@     U R                  R                  5        Hn  u  pUR                  =nc  M  [        [        UR                  5      S5      (       a  M<  [        X5R                  5      nUR	                  X5        [        XU5        Mp     g)z8Set data descriptors on the class for deprecated fields.N__deprecated__)
r   r   deprecation_message_DeprecatedFieldDescriptorr   rB  r   r   r   wrapped_property)r   field
field_infomsgdesccomputed_field_infos         rK   r   r     s     44::<111C>-c2Dc)C%	 = '*&F&F&L&L&N"';;;SH34G4X4XY[kll-c3W3WXDc)C% 'OrM   c                  T    \ rS rSr% SrS\S'   SSS jjrSS jrSSS jjrSS	 jr	S
r
g)r\  i  aC  Read-only 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.
rO   
field_nameNc                    Xl         X l        g rw   )r`  r]  )rF   r`  r]  s      rK   r   #_DeprecatedFieldDescriptor.__init__  s     0rM   c                    X l         g rw   )rd  )rF   r   r   s      rK   r   '_DeprecatedFieldDescriptor.__set_name__  s    rM   c                b   Uc>  U R                   b  U R                   R                  S U5      $ [        U R                  5      e[        R
                  " U R                  [        R                  SS9  U R                   b  U R                   R                  X5      $ UR                  U R                     $ )Nr   rp   )
r]  __get__r   rd  r@   rA   r`  builtinsDeprecationWarningr   )rF   r   obj_types      rK   rj  "_DeprecatedFieldDescriptor.__get__  s    ;$$0,,44T8DD 11dhh ; ;J  ,((00??||DOO,,rM   c                ,    [        U R                  5      erw   )r   rd  )rF   r   r(  s      rK   __set__"_DeprecatedFieldDescriptor.__set__  s    T__--rM   )rd  r`  r]  rw   )r`  rO   r]  zproperty | NonerQ   rR   )r   ro   r   rO   rQ   rR   )r   zBaseModel | Nonerm  ztype[BaseModel] | NonerQ   r   )r   r   r(  r   rQ   r   )rS   rT   rU   rV   rW   r   r   r   rj  rp  rX   rN   rM   rK   r\  r\    s"     O1
-.rM   r\  c                  6    \ rS rSrSrSS jrS	S jrS
S jrSrg)_PydanticWeakRefi  a  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`).
c                P    Uc  S U l         g [        R                  " U5      U l         g rw   )_wrweakrefref)rF   r   s     rK   r   _PydanticWeakRef.__init__  s     ; DH{{3'DHrM   c                >    U R                   c  g U R                  5       $ rw   ru  r   s    rK   __call___PydanticWeakRef.__call__  s    8888:rM   c                    [         U " 5       44$ rw   )rs  r   s    rK   
__reduce___PydanticWeakRef.__reduce__  s    $&**rM   rz  N)r   r   )rQ   r   )rQ   z4tuple[Callable, tuple[weakref.ReferenceType | None]])	rS   rT   rU   rV   rW   r   r{  r~  rX   rN   rM   rK   rs  rs    s     (+rM   rs  c                    U c  g0 nU R                  5        H  u  p# [        U5      nXAU'   M     U$ ! [         a    Un Nf = f)aH  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   rs  r   )dresultrG   rH   proxys        rK   r   r     sX     	yF		$Q'E q	  M  	E	s   2A Ac                    U c  g0 nU R                  5        H0  u  p#[        U[        5      (       a  U" 5       nUb  X1U'   M*  M,  X1U'   M2     U$ )zAInverts the transform performed by `build_lenient_weakvaluedict`.N)r   r?   rs  )r  r  rG   rH   s       rK   r   r     sW    yF	a)**A}q	  1I  MrM   )maxsizec                     SSK Jn   [        [        [        [
        [        U [        /n[        R                  S:  a  UR                  [        R                  5        [        U5      $ )Nr   )r3   )      )r  r3   r   r  r   r  r   r   r  version_infoappendr   r   )r3   r   s     rK   r  r    sR    * 	M 7"V112rM   )r\   zLiteral[False]rQ   r   r   )r   r   r   r   rQ   zCallable[..., Any] | None)
r   r   r   r   r"  set[str]r#  r  rQ   zdict[str, ModelPrivateAttr])r   ro   r   r   rQ   rR   )r   ro   rQ   r   )
r   ro   r   r   r   r   r   NsResolver | NonerQ   rR   )r   ro   r   rO   r   r   r   r   r   r  r   r   rQ   r   )r   ro   rQ   rR   )r  dict[str, Any] | NonerQ   r  )rQ   r   )jrW   
__future__r   _annotationsrk  r>  r  r   r@   rv  abcr   r  r   r   typesr   r   r	   r
   r   r   r   pydantic_corer   r   typing_extensionsr   r   r   r   errorsr   r   plugin._schema_validatorr   r   r   _configr   _decoratorsr   r   r   r   _fieldsr    r!   r"   _generate_schemar#   	_genericsr$   r%   _import_utilsr&   r'   _mock_val_serr(   _namespace_utilsr)   _schema_generation_sharedr*   
_signaturer+   _typing_extrar,   r-   r.   r/   r0   _utilsr1   r2   r   r  r3   r4   r5   r6   PydanticModelFieldr7   PydanticModelPrivateAttrmainr8   rl  rP   __setattr__r  r   r:   r^   rb   rg   r   r   r   r0  r   r   r   r\  rs  r   r   r  rN   rM   rK   <module>r     s!   ( 2   
     (  B B = V V C > O " s s Y Y , F M * ( C 3  9	GG4@  3%x##
)$ 
) !
 	 T=OQikv<wxtW t ytnG$	EE(E E  	E
 !EP
% +	+ + "+ #	+
 
+L %)&*Z	ZZ "Z
 Z #Z $Z 
Zz&&". ".J +  +F(  4   rM   