+
    7*ij  c                  s   R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHtHt ^ RIHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0 ^ R	I1H2t2 ^ R
I3H4t4H5t5H6t6H7t7H8t8H9t9 ^ RI:H;t; ^ RI<H=t= ^ RI>H?t? ^ RI@HAtA ^ RIBHCtC ^ RIDHEtE ^ RIFHGtGHHtHHItIHJtJHKtKHLtLHMtMHNtNHOtOHPtP ^ RIQHRtR ^ RISHTtT ^ RIUHVtW ^ RIXHYtY ^ RIZH[t[ Rt\Rt]Rt^Rt_Rt`RtaRtbRtcRtd0 RSmte]eR 0,
          tf][! ]W4      tgR!th^tVR" R# lti ! R$ R%]74      tj ! R& R'4      tkR( R) ltl ! R* R+4      tm ! R, R-4      tn ! R. R/4      to ! R0 R1]C4      tp ! R2 R34      tqR4 R5 ltr]! R6R7R84      ts]! R9R:R84      tt]! R;R<R84      tu]! R=R>R84      tv]! R?R@R84      tw]! R?RAR84      tx]! R?RBR84      tyRC RD ltzRE RF lt{RG RH lt|RI RJ lt}RK RL lt~RM RN ltRTRO RP lltRQ RR ltR# )Uz^This module includes classes and functions designed specifically for use with the mypy plugin.)annotationsN)Iterator)ConfigParser)AnyCallable)	ErrorCode)expand_typeexpand_type_by_instance) 	ARG_NAMEDARG_NAMED_OPTARG_OPTARG_POS	ARG_STAR2	INVARIANTMDEFArgumentAssignmentStmtBlockCallExprClassDefContext	DecoratorDictExprEllipsisExpr
ExpressionFuncDefIfStmtJsonDict
MemberExprNameExprPassStmtPlaceholderNodeRefExpr	StatementStrExprSymbolTableNodeTempNode	TypeAliasTypeInfoVar)Options)CheckerPluginInterfaceClassDefContextMethodContextPluginReportConfigContextSemanticAnalyzerPluginInterface)deserialize_and_fixup_type)set_callable_name)make_wildcard_trigger)state)TypeTranslator)map_type_from_supertype)
AnyTypeCallableTypeInstanceNoneTypeType	TypeOfAnyTypeTypeTypeVarType	UnionTypeget_proper_type)fill_typevars)get_unique_redefinition_name)__version__)_fields)parse_mypy_versionpydantic-mypyzpydantic-mypy-metadatazpydantic.main.BaseModelz#pydantic_settings.main.BaseSettingszpydantic.root_model.RootModelz5pydantic._internal._model_construction.ModelMetaclasszpydantic.fields.Fieldzpydantic.dataclasses.dataclass.pydantic.functional_validators.model_validator0pydantic.functional_serializers.model_serializerZbuiltinsc                    V ^8  d   QhRRRR/# )   versionstrreturnztype[Plugin] Zformat   "2/usr/lib/python3.14/site-packages/pydantic/mypy.py__annotate__rP   m   s      C L     c                s    \         # )a  `version` is the mypy version string.

We might want to use this to print a warning if the mypy version being used is
newer, or especially older, than we expect (or need).

Args:
    version: The mypy version string.

Return:
    The Pydantic mypy plugin type.
)PydanticPlugin)rI      &rO   pluginrT   m   s
     rQ   c                  sz   a  ] tR t^|tRtR V 3R lltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltRtV ;t# )rR   zThe Pydantic mypy plugin.c               rG   rH   optionsr(   rK   NonerL   rM   rN   rO   rP   PydanticPlugin.__annotate__   s     " " "D "rQ   c                	s   < \        V4      V n        V P                  P                  4       V n        \        SV `  V4       R # N)PydanticPluginConfigplugin_configto_data_plugin_datasuper__init__)selfrV   	__class__   &&rO   r_   ZPydanticPlugin.__init__   s4    1': ..668!rQ   c               rG   rH   fullnamerJ   rK   z(Callable[[ClassDefContext], None] | NonerL   rM   rN   rO   rP   rX      s      C 4\ rQ   c                s    V P                  V4      pV'       dR   \        VP                  \        4      '       d2   VP                  P	                  \
        4      '       d   V P                  # R# )zUpdate Pydantic model class.N)lookup_fully_qualified
isinstancenoder&   has_baseBASEMODEL_FULLNAME$_pydantic_model_class_maker_callback)r`   rd   sym   && rO   get_base_class_hookZ"PydanticPlugin.get_base_class_hook   sJ    ))(3:chh11xx  !344@@@rQ   c               rG   rc   rL   rM   rN   rO   rP   rX      s      3 3[ rQ   c                s4    V\         8X  d   V P                  # R# )z,Update Pydantic `ModelMetaclass` definition.N)MODEL_METACLASS_FULLNAME)_pydantic_model_metaclass_marker_callbackr`   rd      &&rO   get_metaclass_hookZ!PydanticPlugin.get_metaclass_hook   s    //AAArQ   c               rG   )rH   rd   rJ   rK   z&Callable[[MethodContext], Type] | NonerL   rM   rN   rO   rP   rX      s       0V rQ   c                s@    VP                  R4      '       d   \        # R# )z-Adjust return type of `from_orm` method call.z	.from_ormN)endswithfrom_attributes_callbackrp   rq   rO   get_method_hookZPydanticPlugin.get_method_hook   s    [))++rQ   c               rG   )rH   ctxr-   rK   dict[str, Any]rL   rM   rN   rO   rP   rX      s     ! !&9 !n !rQ   c                s    V P                   # )zZReturn all plugin config data.

Used by mypy to determine if cache needs to be discarded.
)r]   )r`   rv   rq   rO   report_config_dataZ!PydanticPlugin.report_config_data   s    
    rQ   c               rG   rH   rv   r*   rK   rW   rL   rM   rN   rO   rP   rX      s          D  rQ   c                	s    \        VP                  VP                  VP                  V P                  4      pVP                  4        R # rY   )PydanticModelTransformerclsreasonapir[   	transform)r`   rv   Ztransformerrl   rO   rj   Z3PydanticPlugin._pydantic_model_class_maker_callback   s0    .sww

CGGTM_M_`rQ   c               rG   ry   rL   rM   rN   rO   rP   rX      s     @ @_ @QU @rQ   c                s    V P                   P                  '       d   R# VP                  P                  P                  p\        VP                  RR4      '       d   RVP                  n        R# R# )zReset dataclass_transform_spec attribute of ModelMetaclass.

Let the plugin handle it. This behavior can be disabled
if 'debug_dataclass_transform' is set to True', for testing purposes.
Ndataclass_transform_spec)r[   debug_dataclass_transformr{   infoZdeclared_metaclassgetattrtyper   )r`   rv   Zinfo_metaclassrl   rO   ro   Z8PydanticPlugin._pydantic_model_metaclass_marker_callback   sV     77788>&&(BDII;?N8 JrQ   )r]   r[   )__name__
__module____qualname____firstlineno____doc__r_   rm   rr   ru   rx   rj   ro   __static_attributes____classcell__ra      @rO   rR   rR   |   s5    #" "
! @ @rQ   rR   c                  s`    ] tR t^t$ RtRtR]R&   R]R&   R]R&   R]R&   R R ltR	 R
 ltRt	R# )rZ   a  A Pydantic mypy plugin config holder.

Attributes:
    init_forbid_extra: Whether to add a `**kwargs` at the end of the generated `__init__` signature.
    init_typed: Whether to annotate fields in the generated `__init__`.
    warn_required_dynamic_aliases: Whether to raise required dynamic aliases error.
    debug_dataclass_transform: Whether to not reset `dataclass_transform_spec` attribute
        of `ModelMetaclass` for testing purposes.
init_forbid_extra
init_typedwarn_required_dynamic_aliasesr   boolc               rG   rU   rL   rM   rN   rO   rP   !PydanticPluginConfig.__annotate__   s     , , ,D ,rQ   c                	s   VP                   f   R # \        VP                   4      pVez   VP                  R/ 4      P                  R/ 4      pV P                   FE  pVP                  VR4      p\	        V\
        4      '       g   \        RV 24      h\        WV4       KG  	  R # \        4       pVP                  VP                   4       V P                   F'  pVP                  \        VRR7      p\        WV4       K)  	  R # )NZtoolrD   Fz/Configuration value must be a boolean for key: )Zfallback)config_file
parse_tomlget	__slots__rf   r   Z
ValueErrorsetattrr   ZreadZ
getbooleanCONFIGFILE_KEY)r`   rV   Ztoml_configconfigkeyZsettingr[   s   &&     rO   r_   ZPydanticPluginConfig.__init__   s    & !4!45" __VR044_bIF~~ **S%0!'400$'VWZV[%\]]7+	 & )NMw223~~'22>3QV2W7+ &rQ   c                   V ^8  d   QhRR/# rH   rK   rw   rL   rM   rN   rO   rP   r      s     C C CrQ   c                sV    V P                    Uu/ uF  q\        W4      bK  	  up# u upi )z/Returns a dict of config names to their values.)r   r   )r`   r   s   & rO   r\   ZPydanticPluginConfig.to_data   s&    37>>B>CWT''>BBBs   &rL   N)r   r   r   r   )
r   r   r   r   r   r   __annotations__r_   r\   r   rL   rQ   rO   rZ   rZ      s9    I #''##,&C CrQ   rZ   c               rG   )rH   rv   r+   rK   r9   rL   rM   rN   rO   rP   rP      s     # #- #D #rQ   c                sL   V P                   p\        V\        4      '       d   VP                  p\        V\        4      '       d.   \        VP
                  \        4      '       d   VP
                  pMb\        V\        4      '       d   TpMIRV RVP                  P                   R2p\        W0P                  V P                  4       V P                  # VP                   P                  P                  \        4      pVf   V P                  # VP                   P!                  \"        4      '       g   V P                  # VP                  R/ 4      P                  R4      pVRJd6   \%        VP                   P&                  V P                  V P                  4       V P                  # )z1Raise an error if from_attributes is not enabled.z
ctx.type: z
 (of type Z)r   from_attributesT)r   rf   r;   Zitemr6   Zret_typer7   ra   r   error_unexpected_behaviorr}   contextZdefault_return_typemetadatar   METADATA_KEYrh   ri   error_from_attributesname)rv   Zctx_typeZ
model_typedetailZpydantic_metadatar   s   &     rO   rt   rt      s=    xxH(H%%==(L))j9J9JH.U.U&&
	Hh	'	'
hZz(2D2D2M2M1NaP!&''3;;?&&&"0044\B &&&??##$677&&&'++Hb9==>OPOd"joo22CGGS[[I"""rQ   c                  s    ] tR t^tRtR R ltR R ltRR R lltRR R	 lltR
 R lt	]
R R l4       tR R ltRtR# )PydanticModelFieldz5Based on mypy.plugins.dataclasses.DataclassAttribute.c               s@    V ^8  d   QhRRRRRRRRRRR	R
RRRRRRRR/
# )rH   r   rJ   aliasz
str | None	is_frozenr   has_dynamic_aliashas_defaultstrictbool | Nonelineintcolumnr   Type | Noner   r&   rL   rM   rN   rO   rP   PydanticModelField.__annotate__   sn        	
        rQ   c                	s~    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn        Wn	        R # rY   )
r   r   r   r   r   r   r   r   r   r   )r`   r   r   r   r   r   r   r   r   r   r   s   &&&&&&&&&&&rO   r_   ZPydanticModelField.__init__   s8     	
"!2&			rQ   c               s<    V ^8  d   QhRRRRRRRRRRRR	R
RRRRR/	# )rH   current_infor&   typedr   model_strictforce_optional	use_aliasr}   r.   force_typevars_invariantis_root_model_rootrK   r   rL   rM   rN   rO   rP   r     sd     
 

 
 	

 
 
 -
 #'
 !
 

rQ   c	                sn   V P                  WWW4      p	V P                  f   TMV P                  p
V'       g	   V
'       d   V P                  WRR7      pM\        \        P
                  4      p\        T	TRV'       d   \        R7      # V'       g   V P                  '       d   \        R7      # \        R7      # )zABased on mypy.plugins.dataclasses.DataclassAttribute.to_argument.NT)include_root_type)variabletype_annotationZinitializerkind)to_varr   r   r5   r:   explicitr   r
   r   r	   r   )r`   r   r   r   r   r   r}   r   r   r   r   r      &&&&&&&&&   rO   to_argumentZPydanticModelField.to_argument  s     ;;|)V!%!4$++F"..|TX.YO%i&8&89O+! 	
 	
 $2T5E5E5E-
 	
 LU
 	
rQ   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rH   r   r&   r}   r.   r   r   r   rK   r   rL   rM   rN   rO   rP   r   2  s<     + ++ -+ #'	+
  + 
+rQ   c                s   V'       dL   \        V P                  \        4      '       d,   V P                  P                  4       p\        Vn        WPn        V P                  EeU   V P                  P                  Ee<   \        P                  ! VP                  P                  4      ;_uu_ 4        \        V4      pV'       d7   VP                   F&  p\        V\        4      '       g   K  \        Vn        K(  	  \        V P                  V P                  P                  P                  V/4      pV'       dv   \        V\         4      '       d`   \#        VP                  4      '       dE   VP                  R,          P                  p	V	f   VuuRRR4       # \%        W4      p
\'        W.4      pVuuRRR4       # V P                  #   + '       g   i     T P                  # ; i)zABased on mypy.plugins.dataclasses.DataclassAttribute.expand_type.Nroot)rf   r   r<   copy_modifiedr   Zvariancer   	self_typer2   strict_optional_setrV   strict_optionalr?   argsr   Zidr7   is_root_modelr   r=   )r`   r   r}   r   r   Zmodified_typeZfilled_with_typevarsargZexpanded_typeZ	root_typeZexpanded_root_types   &&&&&      rO   r   ZPydanticModelField.expand_type2  s_    $
 $))[11 $		 7 7 9)2&)	99 TYY%8%8%D
 **3;;+F+FGG'4\'B$ ,388%c;77+4CL  9 !,DII		8K8K8N8NPd7e f$M8)L)LQ^_l_q_qQrQr !. 2 26 : ? ?I (,! HG" *A)Z&$-}.Q$RM$' HG( yy) HG( yys   .6G)B GGG	c          
     r   )
rH   r   r&   r}   r.   r   r   r   rK   r'   rL   rM   rN   rO   rP   r   _  sC     X XX -X 	X
 #'X 
XrQ   c                s    V'       d   V P                   e   V P                   pMV P                  p\        WPP                  WV4      4      # )z<Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.)r   r   r'   r   )r`   r   r}   r   r   r   s   &&&&& rO   r   ZPydanticModelField.to_var_  s;     /::D99D4)),=UVWWrQ   c               r   rH   rK   r   rL   rM   rN   rO   rP   r   n  s     
 
8 
rQ   c                s    RV P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  RV P                  R	V P                  P                  4       /	# )
?Based on mypy.plugins.dataclasses.DataclassAttribute.serialize.r   r   r   r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   	serializer`   rS   rO   r   ZPydanticModelField.serializen  sl     DIITZZ!7!74++dkkDIIdkkDII'')

 
	
rQ   c               (    V ^8  d   QhRRRRRRRR/# )	rH   r   r&   datar   r}   r.   rK   r   rL   rM   rN   rO   rP   r   ~  s*     0 0x 0x 0>] 0bt 0rQ   c                sp    VP                  4       p\        VP                  R4      V4      pV ! RRVRV/VB # )ABased on mypy.plugins.dataclasses.DataclassAttribute.deserialize.r   r   rL   )copyr/   Zpop)r{   r   r   r}   typs   &&&& rO   deserializeZPydanticModelField.deserialize}  s<     yy{(&)93?//$/$//rQ   c               $    V ^8  d   QhRRRRRR/# )rH   sub_typer&   r}   r.   rK   rW   rL   rM   rN   rO   rP   r     s(     T TH TCb Tgk TrQ   c                s   V P                   ec   \        P                  ! VP                  P                  4      ;_uu_ 4        \        V P                   WP                  4      V n         RRR4       R# R#   + '       g   i     R# ; i)zhExpands type vars in the context of a subtype when an attribute is inherited
from a generic super type.
N)r   r2   r   rV   r   r4   r   )r`   r   r}      &&&rO   expand_typevar_from_subtypeZ.PydanticModelField.expand_typevar_from_subtype  sW     99 **3;;+F+FGG3DIIxS	 HG !GGGs   &A33B	)
r   r   r   r   r   r   r   r   r   r   N)FFF)r   r   r   r   r   r_   r   r   r   r   classmethodr   r   r   rL   rQ   rO   r   r      s@    ?0
:+ZX
 0 0T TrQ   r   c                  sB    ] tR tRtRtR t]R R l4       tR R ltRt	R	# )
PydanticModelClassVari  zBased on mypy.plugins.dataclasses.DataclassAttribute.

ClassVars are ignored by subclasses.

Attributes:
    name: the ClassVar name
c                	s    Wn         R # rY   r   )r`   r   rq   rO   r_   ZPydanticModelClassVar.__init__  s    	rQ   c               rG   )rH   r   r   rK   r   rL   rM   rN   rO   rP   "PydanticModelClassVar.__annotate__  s      x ,A rQ   c                s2    VP                  4       pV ! R/ VB # )r   rL   )r   )r{   r   rq   rO   r   Z!PydanticModelClassVar.deserialize  s     yy{{T{rQ   c               r   r   rL   rM   rN   rO   rP   r     s     
 
8 
rQ   c                s    RV P                   /# )r   r   r   r   rS   rO   r   ZPydanticModelClassVar.serialize  s     DII
 	
rQ   r   N)
r   r   r   r   r   r_   r   r   r   r   rL   rQ   rO   r   r     s*      

 
rQ   r   c                  sX   ] tR tRt$ Rt0 R/mtR]R&   R R ltR R ltR	 R
 lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR0R R llt]R R  l4       t]R! R" l4       t]R# R$ l4       t]R% R& l4       tR0R' R( lltR) R* lt]R+ R, l4       tR-tR.# )1rz   i  zTransform the BaseModel subclass according to the plugin settings.

Attributes:
    tracked_config_fields: A set of field configs that the plugin has to track their value.
zset[str]tracked_config_fieldsc          
     s,    V ^8  d   QhRRRRRRRRR	R
/# )rH   r{   r   r|   zExpression | Statementr}   r.   r[   rZ   rK   rW   rL   rM   rN   rO   rP   %PydanticModelTransformer.__annotate__  s<     + ++ '+ -	+
 ,+ 
+rQ   c                	s6    Wn         W n        W0n        W@n        R # rY   )_cls_reason_apir[   )r`   r{   r|   r}   r[   s   &&&&&rO   r_   Z!PydanticModelTransformer.__init__  s     		*rQ   c               r   )rH   rK   r   rL   rM   rN   rO   rP   r     s     " "4 "rQ   c           	     s   V P                   P                  p\        V4      pV P                  4       pV P	                  W24      w  rEVe   Vf   R# V F  pVP
                  e   K   R# 	  VP                  \        4      pV P                  WCWr4       V P                  WCWr4       V P                  W@P                  VP                  RJ R7       V P                  4        RV Uu/ uF  qfP                  VP                  4       bK  	  upRV Uu/ uF  qP                  VP                  4       bK  	  upRVP!                  4       /VP"                  \$        &   R# u upi u upi )aV  Configures the BaseModel subclass according to the plugin settings.

In particular:

* determines the model config and fields,
* adds a fields-aware signature for the initializer and construct methods
* freezes the class if frozen = True
* stores the fields, config, and if the class is settings in the mypy metadata for access by subclasses
FT)frozenfields
class_varsr   )r   r   r   collect_configcollect_fields_and_class_varsr   rh   BASESETTINGS_FULLNAMEadd_initializeradd_model_construct_method
set_frozenr   r   adjust_decorator_signaturesr   r   get_values_dictr   r   )	r`   r   Zis_a_root_modelr   r   r   fieldis_settingsZ	class_vars	   &        rO   r~   Z"PydanticModelTransformer.transform  s1    yy~~'-$$&!??X>Z/Ezz!  mm$9:V[J''U		&--42GH((* &I&zz5??#44&IR\]R\Y>>9+>+>+@@R\]f,,.'
l#  J]s    #E
#E
c               r   )rH   rK   rW   rL   rM   rN   rO   rP   r     s     2 2T 2rQ   c                s  a V P                   P                  P                  P                  4        EFA  p\	        VP
                  \        4      '       g   K&  VP
                  P                  ^ ,          o\	        S\        4      '       g   K[  \	        SP                  \        4      '       g   K}  SP                  P                  \        9   g   K  SP                  P                  \        8X  dj   \        ;QJ d2    V3R l\        SP                   4       4       F  '       g   K   RM'	  RM#! V3R l\        SP                   4       4       4      '       d   EK&  RVP
                  P"                  n        EKD  	  R# )a  When we decorate a function `f` with `pydantic.validator(...)`, `pydantic.field_validator`
or `pydantic.serializer(...)`, mypy sees `f` as a regular method taking a `self` instance,
even though pydantic internally wraps `f` with `classmethod` if necessary.

Teach mypy this by marking any function whose outermost decorator is a `validator()`,
`field_validator()` or `serializer()` call as a `classmethod`.
c              3  s   <"   T FL  w  rSP                   V,          R 8H  ;'       d(    \        V\        4      ;'       d    VP                  R8H  x  KN  	  R# 5i)ZmodeZafterN)	arg_namesrf   r"   value)Z.0ir   	first_decs   &  rO   Z	<genexpr>ZGPydanticModelTransformer.adjust_decorator_signatures.<locals>.<genexpr>  sR       *C &//2f<rrCQXAYrr^a^g^gkr^rr*Cs   #AAATFN)r   r   namesvaluesrf   rg   r   Zoriginal_decoratorsr   calleer   rd   (IMPLICIT_CLASSMETHOD_DECORATOR_FULLNAMESMODEL_VALIDATOR_FULLNAMEZany	enumerater   funcis_class)r`   rk   r   s   & @rO   r   Z4PydanticModelTransformer.adjust_decorator_signatures  s     99>>''..0C#((I..HH88;	y(33"9#3#3X>>!((115]] "((115MMC  *3INN*C CCC  *3INN*C    .2CHHMM*# 1rQ   c               r   )rH   rK   ModelConfigDatarL   rM   rN   rO   rP   r     s     J J JrQ   c           
     sD   V P                   p\        4       pRpRpVP                  P                  4        F3  w  rVV P	                  WV4      pV'       g   K   RpVP                  V4       K5  	  RpVP                  P                   EFf  p\        V\        \        34      '       g   K"  \        V\        4      '       EdG   VP                  ^ ,          p	\        V	\        4      '       d   V	P                  R8w  d   Ku  \        VP                  \        4      '       dh   \!        VP                  P"                  VP                  P$                  4       F-  w  rV
f   K  VP                  V P	                  WRR7      4       K/  	  EMB\        VP                  \&        4      '       dc   VP                  P                   FH  w  r\        V\(        4      '       g   K  VP                  V P	                  VP*                  V4      4       KJ  	  M\        V\        4      '       d   VP                  R8w  d   EK  VP                  P                   F{  p\        V\        4      '       g   K  VP                  ^ ,          p	\        V	\        4      '       g   KF  VP                  V P	                  V	P                  VP                  4      4       K}  	  V'       d   V P,                  P/                  RV4        MRpEKi  	  V'       g	   V'       dq   V'       di   VP0                  '       dW   VP2                  '       gE   VP4                  '       g3   V P6                  P8                  '       d   \;        V P,                  V4       VP<                  P>                  R,           F  p\@        VPB                  9  d   K  V P,                  PE                  \G        VPH                  4      4       VPB                  \@        ,          R	,          P                  4        F  w  ppVPK                  VV4       K  	  K  	  V# )
zhCollects the values of the config attributes that are used by the plugin, accounting for parent classes.FTNmodel_config)	lax_extraZConfigzYSpecifying config in two places is ambiguous, use either Config attribute or class kwargs:i   NNr   )&r   r   Zkeywordsitemsget_config_updateupdatedefsbodyrf   r   r   lvaluesr   r   rvaluer   zipr   r   r   r"   r   r   failhas_alias_generatorvalidate_by_namepopulate_by_namer[   r   error_required_dynamic_aliasesr   mror   r   add_plugin_dependencyr1   rd   
setdefault)r`   r{   r   Zhas_config_kwargsZhas_config_from_namespacer   exprZconfig_datastmtlhsarg_namer   Zkey_exprZ
value_exprZsubstmtr   r   s   &                rO   r   Z'PydanticModelTransformer.collect_config  s   ii "!$)! ,,,,.JD00<K{$(!k*	 / "&HHMMDd^X$>??$//ll1o!#x00CHH4Ndkk844),T[[-B-BDKKDTDT)U#+$d&<&<XVZ&<&[\ *V  X66040A0A,)(G<<$d&<&<X^^Z&XY 1B
 D(++99(#yy~~G%g~>> !//!,C%c844 MM$"8"87>>"RS  . !		o (,%M "P  9...000F4K4K4K&&DDD.tyy$?HHLL$$D4==0 II++,A$--,PQ#}}\:8DJJLe!!$.  M % rQ   c               r   )rH   r   r   r   r   rK   zJtuple[list[PydanticModelField] | None, list[PydanticModelClassVar] | None]rL   rM   rN   rO   rP   r   P  s.     BL BL+BL<@BL	SBLrQ   c                s:   V P                   p/ p/ p\        VP                  P                  ^R 4       EF  p\        VP
                  9  d   K  V P                  P                  \        VP                  4      4       VP
                  \        ,          R,          P                  4        F  w  rx\        P                  WhV P                  4      p	V	P                  VP                  V P                  4       WV&   VP                  P                  P                  V4      p
V
'       g   K~  V
P                   '       g   K  \#        V
P                   \$        4      '       d   K  V P                  P'                  RV
P                   4       K  	  VP
                  \        ,          R,          P                  4        F  w  rx\(        P                  V4      WW&   K  	  EK  	  \+        4       p\+        4       pV P-                  VP.                  4       F  pV P1                  WV4      pVf   K  VP2                  ^ ,          p\#        V\        4      '       d]   V'       d*   VP4                  R8w  d   \7        V P                  V4       Ku  VP9                  VP4                  4       WVP4                  &   K  \#        V\(        4      '       g   K  VP9                  VP4                  4       WVP4                  &   K  	  \;        VP=                  4       4      \;        VP=                  4       4      3# )zACollects the fields for the model, accounting for parent classes.r   z7BaseModel field may only be overridden by another fieldr   r   i)r   Zreversedr   r
  r   r   r   r  r1   rd   r   r   r   r   r   r   rg   rf   r'   r  r   Zset%_get_assignment_statements_from_blockr   $collect_field_or_class_var_from_stmtr  r    error_extra_fields_on_root_modelZaddZlistr   )r`   r   r   r{   Zfound_fieldsZfound_class_varsr   r   r   r   sym_nodeZcurrent_field_namesZcurrent_class_vars_namesr  Zmaybe_fieldr  s   &&&             rO   r   Z6PydanticModelTransformer.collect_fields_and_class_varsP  s@    ii 79=?SXX\\!B/0D 4==0 II++,A$--,PQ"mmL9(CIIK
*66t499M
 11#((DIIF%*T"88>>--d38jPS6T6TIINNQ  L  #mmL9,GMMO
)>)J)J4)P & P5 1< ),-0U >>sxxHDCCDXhiK",,q/C+'9:: SXX%74TYYE'++CHH5-8*K)>??(,,SXX6-8* I" L'')*D1A1H1H1J,KKKrQ   c               rG   )rH   r  r   rK   Iterator[AssignmentStmt]rL   rM   rN   rO   rP   r     s     R R RLd RrQ   c              #  	s8  "   VP                    F0  pVP                  '       d   K  V P                  V4       R j  xL
  K2  	  VP                  eD   VP                  P                  '       g&   V P                  VP                  4       R j  xL
  R # R # R #  L[ L5irY   )r  Zis_unreachabler  Z	else_body)r`   r  r  rl   rO   ,_get_assignment_statements_from_if_statementZEPydanticModelTransformer._get_assignment_statements_from_if_statement  sx     IID&&&EEdKKK  >>%dnn.K.K.KAA$..QQQ /L% LQs,   BBB1B-BBBBc               rG   )rH   blockr   rK   r  rL   rM   rN   rO   rP   r     s     S S5 SE] SrQ   c              #  	s   "   VP                    FP  p\        V\        4      '       d   Vx  K  \        V\        4      '       g   K7  V P	                  V4       R j  xL
  KR  	  R #  L
5irY   )r  rf   r   r   r  )r`   r  r  rl   rO   r  Z>PydanticModelTransformer._get_assignment_statements_from_block  sL     JJD$//
D&))LLTRRR	  Ss   ?A'A'A%A'c               r   )	rH   r  r   r   r   r   z dict[str, PydanticModelClassVar]rK   z1PydanticModelField | PydanticModelClassVar | NonerL   rM   rN   rO   rP   r     s2     G
 G
"G
2AG
OoG
	:G
rQ   c                s~	   V P                   pVP                  ^ ,          p\        V\        4      '       d8   \        P
                  ! VP                  4      '       d   VP                  R8X  d   R# VP                  '       g   \        VP                  \        4      '       d   \        VP                  P                  \        4      '       dj   \        VP                  P                  P                  \        4      '       d6   VP                  P                  P                  P                  \        9   d   R# VP                  V9   d   R# \        V P                  V4       R# VP                  ^ ,          p\        V\        4      '       g   R# \        P
                  ! VP                  4      '       d   VP                  R8X  d   R# VP                  P                   P#                  VP                  4      pVf   R# VP$                  p\        V\&        4      '       d   R# \        V\(        4      '       d   V P                  P+                  RV4       R# \        V\,        4      '       g   R# VP.                  '       d   \1        VP                  4      # \3        VP4                  4      p\        V\6        4      '       d8   VP4                  P                  R8X  d   V P                  P+                  RV4       V P9                  V4      p	V P;                  V4      p
VP4                  f   VP<                  '       d   VP>                  '       dq   V P                  PA                  VP                  RR7      pV'       d   Wn        M:V P                  P+                  RV4       \C        \D        PF                  4      Vn        VP<                  '       d   V	'       d   \1        VP                  4      # V PI                  V4      w  rV'       dW   VPJ                  '       gE   VPL                  '       g3   V PN                  PP                  '       d   \S        V P                  V4       V PU                  V4      pV PW                  WeP                  V4      p\Y        VP                  VV	V
VVVPZ                  VP\                  VVP                  R	7
      # )
a&  Get pydantic model field from statement.

Args:
    stmt: The statement.
    model_config: Configuration settings for the model.
    class_vars: ClassVars already known to be defined on the model.

Returns:
    A pydantic model field if it could find the field in statement. Otherwise, `None`.
r   NzFType aliases inside BaseModel definitions are not supported at runtimezdataclasses.InitVarz%InitVar is not supported in BaseModelT)is_finalzGNeed type argument for Final[...] with non-literal default in BaseModel)
r   r   r   r   r   r   r   r   r   r   )/r   r  rf   r   rB   Zis_valid_field_namer   Z
new_syntaxr  r   r   rd   DECORATOR_FULLNAMESerror_untyped_fieldsr   r   r   r   rg   r   r%   r  r'   Zis_classvarr   r>   r   r7   get_has_default
get_strictr  Zis_inferredZanalyze_simple_literal_typer5   r:   Z
from_errorget_alias_infor  r  r[   r   r	  is_field_frozen_infer_dataclass_attr_init_typer   r   r   )r`   r  r   r   r{   r  rk   rg   Z	node_typer   r   r   r   r   r   Z	init_types   &&&&            rO   r  Z=PydanticModelTransformer.collect_field_or_class_var_from_stmt  sT    iill1o#x((0K0KCHH0U0UY\YaYaesYs4;;11t{{118<<t{{1188(CCKK&&--66:MM
 xx:% !D1ll1o#x((**38844N8Rhhnn  *; xxdO,,
 dI&&IINNX $$$
  (22 $DII.	i**y~~/F/FJ_/_IINN7
 **40&88$2B2B2B ))77d7SC			] $I$8$89	===[(22#'#6#6t#< !222l6S6S6S""@@@*499d;((.	88hhM	!/#;;
 	
rQ   c               r   )	rH   rk   r#   r   rJ   r   r   rK   r   rL   rM   rN   rO   rP   r   +  s*     $ $? $# $X_ $do $rQ   c                s   VP                   pVP                  '       d   V# \        VP                   4      p\        V\        4      '       g   V# VP                   P                  R4      pV'       EdP   \        VP                  \        4      '       d   VP                   P                  R4      pVP                   '       d,   \        \        VP                   VP                   V4      4      pM\        \        P                  4      # \        V\        4      '       d>   VP                  \        \        \        .8X  d   \!        VP"                  ^,          V4      # V P$                  P'                  RVP                   P(                   R2V4        V# V P$                  P'                  RVP                   P(                   R2V4       V# )zfInfer __init__ argument type for an attribute.

In particular, possibly use the signature of __set__.
Z__set__z(Unsupported signature for "__set__" in ""zUnsupported "__set__" in ")r   Zimplicitr>   rf   r7   r   rg   r   Zget_containing_type_infor4   r5   r:   Zunannotatedr6   	arg_kindsr   r   	arg_typesr   r  r   )	r`   rk   r   r   defaulttZsetterZ
super_infoZsetter_types	   &&&&     rO   r  Z8PydanticModelTransformer._infer_dataclass_attr_init_type+  sN   
 ((<<<NCHH% !X&&NI&6&++w//VV<<YG
;;;"12I&++WXW]W]_i2j"kK"9#8#899k<88[=R=RW >
 3;3H3H3KQOOIINN%Maffkk]Z[#\^ef  		!;AFFKK=JGTrQ   c          
     r   
rH   r   list[PydanticModelField]r   r   r   r   r   rK   rW   rL   rM   rN   rO   rP   r   Q  s;     4X 4X.4X8G4XVZ4Xko4X	4XrQ   c                s   RV P                   P                  P                  9   d:   V P                   P                  P                  R,          P                  '       g   R# V P                  P
                  p\        VP                  4      pVP                  ;'       g    VP                  '       * ;'       d    VP                  RJp\        VP                  ;'       d    VP                  '       * 4      pV P                  VVVVVVVRR7      p	V'       EdT   V P                  P                  \        4      P                   p
RV
P                  9   Ed   V
P                  R,          P                   pVe   VP"                  e   VP"                  p\%        VP&                  4       F  w  rVe/   VP)                  R4      '       g   VP)                  R4      '       g   K9  V P                  P+                  VP,                  V,          4      pVe0   VR8X  d)   VP/                  \1        \2        P4                  4      4      p\7        W4      pV	P9                  \;        VVR\<        4      4       K  	  V P?                  W4      '       gD   \7        R	4      pV	P9                  \;        V\A        \2        PB                  4      R\D        4      4       \G        V P                  V P                   RV	\I        4       R
7       R# )zAdds a fields-aware `__init__` method to the class.

The added `__init__` will be annotated with types vs. all `Any` depending on the plugin settings.
r_   NFT)r   r   requires_dynamic_aliasesr   r   r   r   Z__Z_Z_cli_settings_sourcekwargs)r   return_type)%r   r   r   plugin_generatedr[   r   r   r   r  r  validate_by_aliasr  get_field_argumentsr   re   r   rg   r   r   r   Z
startswithZ	anal_typer"  ZacceptChangeExplicitTypeOfAnyr:   Zfrom_omitted_genericsr'   appendr   r
   should_init_forbid_extrar5   r   r   
add_methodr8   )r`   r   r   r   r   r   r   r   r'  r   Zbase_settings_nodeZbase_settings_init_nodeZ	func_typeZarg_idxr  Zanalyzed_variable_typer   vars   &&&&&             rO   r   Z(PydanticModelTransformer.add_initializerQ  sR    ---diinn6J6J:6V6g6g6g""--FMM*00KKF4K4KLvvQWQiQiqvQv	#'(B(B(b(b6KbKbGb#c ''%%=#'%) ( 	
 ;!%!A!ABW!X!]!]/555*<*B*B:*N*S*S'*6;R;W;W;c 7 < <I-6y7J7J-K)#+x/B/B4/H/HPXPcPcdgPhPh$151D1DYEXEXY`Ea1b.1=(NdBd 6L5R5R 7	8W8W X62 $'x#HHX7MtU\$]^ .L ,,V<<h-CKKgi.@.@&A4ST499dii$HJWrQ   c          
     r   r%  rL   rM   rN   rO   rP   r     s<     &
 &
(&
  &
 	&

 &
 
&
rQ   c                sf   V P                   P                  \         R2V P                   P                  \         R24      .4      p\        V\	        4       .4      p\        \        RV4      VR\        4      p\        P                  ! V P                   P                  P                  4      ;_uu_ 4        V P                  VR\        VP                  4      RRVVR7      pRRR4       V P                  W4      '       gD   \        R4      p	XP!                  \        V	\#        \$        P&                  4      R\(        4      4       V'       d   XV.,           M	V.X,           p\+        V P                   V P,                  R	V\/        V P,                  P0                  4      RR
7       R#   + '       g   i     L; i)zAdds a fully typed `model_construct` classmethod to the class.

Similar to the fields-aware __init__ method, but always uses the field names (not aliases),
and does not treat settings fields as optional.
z.setz.strZ_fields_setNTF)r   r   r'  r   r   r   r(  Zmodel_construct)r   r)  is_classmethod)r   
named_typeBUILTINS_NAMEr=   r8   r   r'   r
   r2   r   rV   r   r,  r   r   r/  r.  r5   r:   r   r   r0  r   r?   r   )
r`   r   r   r   r   Zset_strZoptional_set_strZfields_set_argumentr   r1  s
   &&&&&     rO   r   Z3PydanticModelTransformer.add_model_construct_method  sX    ))&&-'=		@T@TXeWffjUk@l?mn$gxz%:;&s=:J'KM]_celm&&tyy'8'8'H'HII++!&--0).'+ , D J ,,V<<h-CKKgi.@.@&A4ST/<t*++CVBWZ^B^IIII%diinn5	
! JIs   2,F  F0	c               r   )	rH   r   r&  r}   r.   r   r   rK   rW   rL   rM   rN   rO   rP   r     s2     B B!9 B@_ Bim Brv BrQ   c                s   V P                   P                  pV EF-  pVP                  P                  VP                  4      pVe   VP
                  p\        V\        4      '       d   T;'       g    VP                  Vn	        Kl  \        V\        4      '       d;   V P                  P                  '       g   V P                  P                  4        K  K  K  VP                  WBRR7      pWGn        W7n	        VP                  R,           VP                  ,           Vn        \#        \$        V4      VP                  VP                  &   EK0  	  R# )zMarks all fields as properties so that attempts to set them trigger mypy errors.

This is the same approach used by the attrs and dataclasses plugins.
NF)r   .)r   r   r   r   r   rg   rf   r'   r   Zis_propertyr   r   Zfinal_iterationZdeferr   rd   	_fullnamer#   r   )r`   r   r}   r   r   r   r  r1  s   &&&&    rO   r   Z#PydanticModelTransformer.set_frozen  s    
 yy~~Ezz~~ejj1H#mmc3''&,&?&?CO_55dii>W>W>WIIOO% ?X5 ll4l>"( $ 3chh >'6tS'A

388$# rQ   c               r   )	rH   r   rJ   r   r   r   r   rK   ModelConfigData | NonerL   rM   rN   rO   rP   r     s)     ! !c !
 !t !Xn !rQ   c                sP   WP                   9  d   R# VR8X  dy   \        V\        4      '       d   VP                  R8H  pMF\        V\        4      '       d   VP
                  R8H  pM V'       g   \        WP                  V4       R# \        VR7      # VR8X  d8   Rp\        V\        4      '       d   VP                  R8X  d   Rp\        VR	7      # \        V\        4      '       d+   VP                  R9   d   \        R/ WP                  R
8H  /B # \        WP                  V4       R# )zDetermines the config update due to a single kwarg in the ConfigDict definition.

Warns if a tracked config attribute is set to a value the plugin doesn't know how to interpret (e.g., an int)
NextraZforbid)forbid_extraalias_generatorTbuiltins.NoneF)r  builtins.True)r<  builtins.FalserL   )r   rf   r"   r   r   r   error_invalid_config_valuer   r   r   rd   )r`   r   r   r   r9  r  s   &&&&  rO   r   Z*PydanticModelTransformer.get_config_update  s    
 1117?#w''"yyH4C,,"xx83  /tYYD"==$$"&#x((S\\_-L&+#"7JKKc8$$9\)\"MdLLO,K%LMM"4C8rQ   c               rG   rH   r  r   rK   r   rL   rM   rN   rO   rP   r     s     2 2n 2 2rQ   c                s   V P                   p\        V\        4      '       d   R# \        V\        4      '       d   \        VP                  \
        4      '       d   VP                  P                  \        8X  d   \        VP                  VP                  4       FY  w  r#Ve   VR8X  d   VP                  \        Ju # VR8X  g   K-  \        V\        4      ;'       d    VP                  R8H  '       * u # 	  R# \        V\        4      '       * # )zUReturns a boolean indicating whether the field defined in `stmt` is a required field.Fr#  Zdefault_factoryr;  )r  rf   r$   r   r   r    rd   FIELD_FULLNAMEr  r   r   ra   r   r   r  r  r   r      &   rO   r  Z(PydanticModelTransformer.get_has_default  s     {{dH%%dH%%*T[['*J*Jt{{OcOcguOu
 !DNN;	<49#4==<<,, *3 9 ] ]cllo>]^^ < dL111rQ   c               rG   )rH   r  r   rK   r   rL   rM   rN   rO   rP   r     s       K rQ   c                s   V P                   p\        V\        4      '       d   \        VP                  \        4      '       d   VP                  P
                  \        8X  dr   \        VP                  VP                  4       FM  w  r#VR8w  d   K  \        V\        4      '       d)   VP
                  R8X  d    R# VP
                  R8X  d    R#  R# 	  R# )zEReturns a the `strict` value of a field if defined, otherwise `None`.r   r<  Tr=  FN)r  rf   r   r   r    rd   r@  r  r   r   r   rA  rB  rO   r  Z#PydanticModelTransformer.get_strict  s     {{dH%%*T[['*J*Jt{{OcOcguOu DNN;	8#c8,,||6#)99$ < rQ   c               rG   )rH   r  r   rK   ztuple[str | None, bool]rL   rM   rN   rO   rP   r     s      ^ 0G rQ   c                s@   V P                   p\        V\        4      '       d   R# \        V\        4      '       d@   \        VP                  \
        4      '       d    VP                  P                  \        8X  g   R# RVP                  9   d.   VP                  VP                  P                  R4      ,          pM@RVP                  9   d.   VP                  VP                  P                  R4      ,          pMR# \        V\        4      '       d   VP                  R3# R# )zReturns a pair (alias, has_dynamic_alias), extracted from the declaration of the field defined in `stmt`.

`has_dynamic_alias` is True if and only if an alias is provided, but not as a string literal.
If `has_dynamic_alias` is True, `alias` will be None.
FZvalidation_aliasr   )NF)NT)r  rf   r$   r   r   r    rd   r@  r   r   Zindexr"   r   )r  r  r      &  rO   r  Z'PydanticModelTransformer.get_alias_info  s     {{dH%% tX&&:dkk7+K+KPTP[P[PdPdhvPv /))DNN001CDEC&))DNN009:Cc7##99e##rQ   c               rG   r?  rL   rM   rN   rO   rP   r   0  s      n  rQ   c                s   V P                   p\        V\        4      '       d   R# \        V\        4      '       d@   \        VP                  \
        4      '       d    VP                  P                  \        8X  g   R# \        VP                  4       FH  w  r#VR8X  g   K  VP                  V,          p\        V\        4      ;'       d    VP                  R8H  u # 	  R# )aL  Returns whether the field is frozen, extracted from the declaration of the field defined in `stmt`.

Note that this is only whether the field was declared to be frozen in a `<field_name> = Field(frozen=True)`
sense; this does not determine whether the field is frozen because the entire model is frozen; that is
handled separately.
Fr   r<  )r  rf   r$   r   r   r    rd   r@  r   r   r   r   )r  r  r   r  r   s   &    rO   r  Z(PydanticModelTransformer.is_field_frozen/  s     {{dH%% tX&&:dkk7+K+KPTP[P[PdPdhvPv $T^^4KA8#iil!#x0TTS\\_5TT 5 rQ   c               s<    V ^8  d   QhRRRRRRRRRRRRR	RR
RRR/	# )rH   r   r&  r   r   r   r   r'  r   r   r   rK   list[Argument]rL   rM   rN   rO   rP   r   H  sd      (  	
  #'   #' 
rQ   c	                s   V P                   P                  p	V U
u. uFc  p
V'       d   V
P                  '       d   K  T
P                  T	TTT;'       g    TTV P                  TT;'       d    V
P
                  R8H  R7      NKe  	  pp
V# u up
i )zHelper function used during the construction of the `__init__` and `model_construct` method signatures.

Returns a list of mypy Argument instances for use in the generated signatures.
r   )r   r   r   r   r}   r   r   )r   r   r   r   r   r   )r`   r   r   r   r   r'  r   r   r   r   r   Z	argumentsr   rO   r,  Z,PydanticModelTransformer.get_field_argumentsH  s     yy~~  
  %"9"9	E)7FF;#II)A#0#I#IUZZ65I  	   	 
 
s   BBBB+Bc               r   )rH   r   r&  r   r   rK   r   rL   rM   rN   rO   rP   r   h  s$     4 4/G 4Q` 4ei 4rQ   c                s    VP                   '       g@   VP                  '       g.   V P                  V\        VP                  4      4      '       d   R# VP
                  '       d   R# V P                  P                  # )a(  Indicates whether the generated `__init__` should get a `**kwargs` at the end of its signature.

We disallow arbitrary kwargs if the extra config setting is "forbid", or if the plugin config says to,
*unless* a required dynamic alias is present (since then we can't determine a valid signature).
FT)r  r  is_dynamic_alias_presentr   r  r9  r[   r   )r`   r   r   r   rO   r/  Z1PydanticModelTransformer.should_init_forbid_extrah  s]     '''6+B+B+B,,VT&:T:T5UVV!!333rQ   c               s$    V ^8  d   QhRRRRRR/# )rH   r   r&  r  r   rK   rL   rM   rN   rO   rP   r   v  s$      )A X\ ae rQ   c                s    V  F  pVP                   '       g   K   R# 	  V'       d   V  F  pVP                  e   K   R# 	  R# )zReturns whether any fields on the model have a "dynamic alias", i.e., an alias that cannot be
determined during static analysis.
TF)r   r   )r   r  r   rl   rO   rE  Z1PydanticModelTransformer.is_dynamic_alias_presentu  s>    
 E&&&  ;;&   rQ   )r   r   r   r[   N>   r8  r   r   r:  r   r  r  r+  r   )r   r   r   r   r   r   r   r_   r~   r   r   r   r  r  r  r  r   r   r   r   Zstaticmethodr  r  r  r  r,  r/  rE  r   rL   rQ   rO   rz   rz     s    	'8 	+"H26JXBLHRSG
R$L4Xl&
PB2!F 2 2*    :  0@4  rQ   rz   c                  s>   a  ] tR tRtRtR V 3R lltR R ltRtV ;t# )r-  i  z<A type translator used to change type of Any's, if explicit.c               rG   )rH   type_of_anyr   rK   rW   rL   rM   rN   rO   rP   $ChangeExplicitTypeOfAny.__annotate__  s      C D rQ   c                	s0   < Wn         \        SV `	  4        R # rY   )_type_of_anyr^   r_   )r`   rF  ra   rb   rO   r_   Z ChangeExplicitTypeOfAny.__init__  s    'rQ   c               rG   )rH   r$  r5   rK   r9   rL   rM   rN   rO   rP   rG    s      7 t rQ   c                	s|    VP                   \        P                  8X  d   VP                  V P                  R 7      # V# ))rF  )rF  r:   r   r   rH  )r`   r$  rq   rO   	visit_anyZ!ChangeExplicitTypeOfAny.visit_any  s0    ==I...??t/@/@?AAHrQ   )rH  )	r   r   r   r   r   r_   rI  r   r   r   r   rO   r-  r-    s    F  rQ   r-  c                  sN    ] tR tRtRtRR R lltR R ltR R	 ltR
 R ltRt	R# )r   i  z(Pydantic mypy plugin model config class.Nc               s8    V ^8  d   QhRRRRRRRRRRRRRRR	R/# )
rH   r9  r   r   r   r  r+  r  r  r   rL   rM   rN   rO   rP   ModelConfigData.__annotate__  sZ      !  %	
 & ' & ) rQ   c	                	sf    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        R # rY   )r9  r   r   r  r+  r  r  r   )	r`   r9  r   r   r  r+  r  r  r   s	   &&&&&&&&&rO   r_   ZModelConfigData.__init__  s2     ). 0!2 0#6 rQ   c               r   r   rL   rM   rN   rO   rP   rJ    s     I I IrQ   c                sv    V P                   P                  4        UUu/ uF  w  rVf   K  WbK  	  upp# u uppi )zvReturns a dict of Pydantic model config names to their values.

It includes the config if config value is not `None`.
)Z__dict__r   )r`   kvrC  rO   r   ZModelConfigData.get_values_dict  s3    
 "&!4!4!6H!6!!6HHHs   55c               rG   )rH   r   r7  rK   rW   rL   rM   rN   rO   rP   rJ    s        3    rQ   c                sx    Vf   R# VP                  4       P                  4        F  w  r#\        WV4       K  	  R# )z$Update Pydantic model config values.N)r   r   r   )r`   r   rK  rL  s   &&  rO   r   ZModelConfigData.update  s2    >**,224DADQ 5rQ   c               r   )rH   r   rJ   r   r   rK   rW   rL   rM   rN   rO   rP   rJ    s!     & &c &# &$ &rQ   c                s<    \        W4      f   \        WV4       R# R# )zFSet default value for Pydantic model config if config value is `None`.N)r   r   )r`   r   r   r   rO   r  ZModelConfigData.setdefault  s    4%Du% &rQ   )r9  r   r   r  r  r   r+  r  )NNNNNNNN)
r   r   r   r   r   r_   r   r   r  r   rL   rQ   rO   r   r     s    2(I & &rQ   r   c               rG   )rH   r   r&   rK   r   rL   rM   rN   rO   rP   rP     s     . . .T .rQ   c                s,    V P                  \        4      # )zXReturn whether the type info is a root model subclass (or the `RootModel` class itself).)rh   ROOT_MODEL_FULLNAME)r   rS   rO   r   r     s    ==,--rQ   zpydantic-ormzInvalid from_attributes callZPydanticzpydantic-configzInvalid config valuezpydantic-aliaszDynamic alias disallowedzpydantic-unexpectedzUnexpected behaviorzpydantic-fieldzUntyped field disallowedzInvalid Field defaultsz!Extra field on RootModel subclassc               r   )	rH   
model_namerJ   r}   r)   r   r   rK   rW   rL   rM   rN   rO   rP   rP     s1     \ \c \0F \QX \]a \rQ   c                >    VP                  RV  R2V\        R7       R# )zCEmits an error when the model does not have `from_attributes=True`.r   z$" does not have from_attributes=TrueZcodeN)r  	ERROR_ORM)rN  r}   r   r   rO   r   r     s    HHq@A7QZH[rQ   c               r   )	rH   r   rJ   r}   r.   r   r   rK   rW   rL   rM   rN   rO   rP   rP     s1     O OS O/N OY` Oei OrQ   c                rO  )z0Emits an error when the config value is invalid.zInvalid value for "Config.r   rP  N)r  ERROR_CONFIG)r   r}   r   r   rO   r>  r>    s    HH)$q17HNrQ   c               r   rH   r}   r.   r   r   rK   rW   rL   rM   rN   rO   rP   rP     s)     O O(G ORY O^b OrQ   c                6    V P                  RV\        R7       R# )zfEmits required dynamic aliases error.

This will be called when `warn_required_dynamic_aliases=True`.
z#Required dynamic aliases disallowedrP  N)r  ERROR_ALIASr}   r   rq   rO   r	  r	    s    
 HH2G+HNrQ   c               r   )	rH   r   rJ   r}   z8CheckerPluginInterface | SemanticAnalyzerPluginInterfacer   r   rK   rW   rL   rM   rN   rO   rP   rP     s,     ; ;;N;Y`;	;rQ   c                s^    RpRV  R2pVRV R2,          pVP                  WB\        R7       R# )z Emits unexpected behavior error.z6https://github.com/pydantic/pydantic/issues/new/choosez7The pydantic mypy plugin ran into unexpected behavior: Z
z&Please consider reporting this bug at z so we can try to fix it!rP  N)r  ERROR_UNEXPECTED)r   r}   r   ZlinkZfull_messages   &&&  rO   r   r     s?    
 DDLVHTVWL<TFB[\\LHH\)9H:rQ   c               r   rS  rL   rM   rN   rO   rP   rP     s(     G G= G GTX GrQ   c                rT  )z;Emits an error when there is an untyped field in the model.zUntyped fields disallowedrP  N)r  ERROR_UNTYPEDrV  rq   rO   r  r    s    HH('HFrQ   c               r   )rH   r}   r)   r   r   rK   rW   rL   rM   rN   rO   rP   rP     s(     o o*@ o7 oW[ orQ   c                rT  )z]Emits an error when there is more than just a root field defined for a subclass of RootModel.z2Only `root` is allowed as a field of a `RootModel`rP  N)r  ERROR_EXTRA_FIELD_ROOT_MODELrV  rq   rO   r  r    s    HHA7QmHnrQ   c               s<    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )rH   r}   z8SemanticAnalyzerPluginInterface | CheckerPluginInterfacer{   r   r   rJ   r   rD  r)  r9   r   r   tvar_defzTypeVarType | Noner2  r   rK   rW   rL   rM   rN   rO   rP   rP     sm     U% U%	AU%	U% U% 	U%
 U% U% !U% U% 
U%rQ   c           	     s   VP                   pW(P                  9   du   VP                  V,          p	V	P                  '       dP   \        V	P                  \
        4      '       d0   VP                  P                  P                  V	P                  4       \        V \        4      '       d   V P                  R4      p
MV P                  R. 4      p
V'       d=   T;'       g    \        \        V4      4      p\        \        R4      VR\         R4      .pM1T;'       g    \        V4      p\        \        R4      VR\         4      .pW,           p. . . rpV F^  pVP#                  VP$                  4       VP#                  VP&                  P(                  4       VP#                  VP*                  4       K`  	  \-        YYY'       d   V.MRR7      p\        W#\/        \1        4       .4      4      pVVn         \3        VV4      Vn        VVn        VP8                  R,           V,           Vn        VP<                  Vn        W(P                  9   d6   \?        W(P                  4      pVP                  V,          VP                  V&   V'       dv   RVn         \        VVP4                  4      pVVn         VP:                  Vn        RVn!        \E        V\G        R4      .V4      pVP<                  Vn        \I        \J        V4      p	M\I        \J        V4      p	RV	n        WP                  V&   VPL                  P                  P                  P#                  V4       R# )	zhVery closely related to `mypy.plugins.common.add_method_to_class`, with a few pydantic-specific changes.zbuiltins.functionr   NTZ__pydantic_self__)Z	variablesr5  r   )'r   r   r*  rf   rg   r   r   r  Zremover.   r3  Znamed_generic_typer;   r?   r   r'   r   r.  r   r   r   r   r6   r   r   r0   r   r   rd   r6  r   r@   Zis_decoratedr2  r   r   r#   r   Zdefn)r}   r{   r   r   r)  r   rZ  r2  r   rk   Zfunction_typeZfirstr"  r   r!  r   Z	signaturer   Zr_namerL  Zdecs   &&&&&&&&             rO   r0  r0    s    88D zzjjJsxx$A$AHHMM  *#677':;../BBG>>-*=!>	#f+y$FG44t!4	 #12ItWMN<D&("b)I,,-**+"	  im]ePXzkoI 4uhj\23DDI!)T2DI"DM]]S(4/DN		DI zz-dJJ?!ZZ-

6
  dii nnx67;99dC(dD)CJJtIINNt$rQ   c               rG   )rH   r   rJ   rK   zdict[str, Any] | NonerL   rM   rN   rO   rP   rP   J  s      C $9 rQ   c                sL   V P                  R4      '       g   R# \        P                  R8  d   ^ RIpM ^ RIp\        V R4      ;_uu_ 4       pVP                  V4      uuRRR4       #   \
         d    ^ RIpTP                  R^R7        R# i ; i  + '       g   i     R# ; i)z}Returns a dict of config keys to values.

It reads configs from toml file and returns `None` if the file is not a toml file.
z.tomlNzJNo TOML parser installed, cannot read configuration from `pyproject.toml`.)Z
stacklevelZrb)i   i   )
rs   sysZversion_infoZtomllibZtomliZImportErrorwarningsZwarnZopenZload)r   Ztoml_r\  ZrfrB  rO   r   r   J  s    
 ((
7"	! 
k4	 	 Bzz"~ 
!	   	MMfstMu		 
!	 	 s   A) B)"BBB#	>   z*pydantic.functional_serializers.serializerz.pydantic.deprecated.class_validators.validatorz.pydantic.functional_validators.field_validatorrE   rF   z3pydantic.deprecated.class_validators.root_validator)NNF)r   Z
__future__r    r[  Zcollections.abcr   Zconfigparserr   Ztypingr   r   Zmypy.errorcodesr   Zmypy.expandtyper   r   Z
mypy.nodesr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   Zmypy.optionsr(   Zmypy.pluginr)   r*   r+   r,   r-   r.   Zmypy.plugins.commonr/   Zmypy.semanalr0   Zmypy.server.triggerr1   Z
mypy.stater2   Zmypy.type_visitorr3   Zmypy.typeopsr4   Z
mypy.typesr5   r6   r7   r8   r9   r:   r;   r<   r=   r>   Zmypy.typevarsr?   Z	mypy.utilr@   Zmypy.versionrA   Zmypy_versionZpydantic._internalrB   Zpydantic.versionrC   r   r   ri   r   rM  rn   r@  ZDATACLASS_FULLNAMEr   r  r   ZMYPY_VERSION_TUPLEr4  rT   rR   rZ   rt   r   r   rz   r-  r   r   rQ  rR  rU  rW  rX  ZERROR_FIELD_DEFAULTSrY  r   r>  r	  r   r  r  r0  r   rL   rQ   rO   <module>r]     s   d " 
 $ %   % @! ! ! ! ! ! ! ! !D !  + 5  , 0   ( 2 4 & / '. = 5 R (5 K   ,?BtAu+u ( (5  3@V 3@l+C +C\#4PT PTf
 
2[ [|n (& (&V.
 n&DjQ	*,BJO(*DjQ24I:V *,F
S !13KZX ()9;^`jk \
O
O;G
o
U%prQ   