+
    i̗                        ^ RI t ^ RIHt ^ RIHtHtHtHtHtH	t	H
t
HtHt ^ RI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- ^ RI.H/t/ ^ RI0H1t1H2t2H3t3H4t4H5t5H6t6H7t7 ^ RI8H9t9 ^ R	I:H;t; ^ R
I<H=t= ^ RI>H?t?H@t@HAtAHBtBHCtCHDtDHtHEtEHFtFHGtGHHtHHItIHJtJ ^ RIKHLtL ^ RIMHNtN ^ RIOHPtQ ^ RIRHStS  ^ RI>HTtT RtVRtW]XRRK tY]Y R2tZ]Y R2t[]Y R2t\]Y R2t]]Y R2t^R R lt_]_! ]Q4      t`]`RL8  d   RMRta^tPR R ltb ! R R ]54      tc ! R! R"4      tdR# R$ lte ! R% R&4      tf ! R' R(4      tg ! R) R*4      th]! R+R,R-4      ti]! R.R/R-4      tj]! R0R1R-4      tk]! R2R3R-4      tl]! R4R5R-4      tm]! R4R6R-4      tnR7 R8 ltoR9 R: ltpR; R< ltqR= R> ltrR? R@ ltsRA RB lttRMRC RD lltuRE RF ltvRG RH ltwRI RJ ltxR#   ]U d    ^ RI>HHtT  ELi ; i)N    N)ConfigParser)	AnyCallableDictListOptionalSetTupleTypeUnion)	ErrorCode)	ARG_NAMEDARG_NAMED_OPTARG_OPTARG_POS	ARG_STAR2MDEFArgumentAssignmentStmtBlockCallExprClassDefContext	DecoratorEllipsisExprFuncBaseFuncDefJsonDict
MemberExprNameExprPassStmtPlaceholderNodeRefExprStrExpr
SymbolNodeSymbolTableNodeTempNodeTypeInfoTypeVarExprVarOptions)CheckerPluginInterfaceClassDefContextFunctionContextMethodContextPluginReportConfigContextSemanticAnalyzerPluginInterface)dataclasses)set_callable_name)make_wildcard_trigger)AnyTypeCallableTypeInstanceNoneType
Overloaded
ProperTyper   	TypeOfAnyTypeType	TypeVarIdTypeVarType	UnionTypeget_proper_type)fill_typevars)get_unique_redefinition_name)__version__)is_valid_field)
TypeVarDef)r@   pydantic-mypyzpydantic-mypy-metadataz.main.BaseModelz.env_settings.BaseSettingsz.main.ModelMetaclassz.fields.Fieldz.dataclasses.dataclassc                J    V ^8  d   QhR\         R\        \        R3,          /# )   versionreturn.)strr
   int)formats   "W/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/pydantic/v1/mypy.py__annotate__rQ   W   s&     A A Ac3h A    c                 ~    \        \        \        V P                  R 4      ^ ,          P	                  R4      4      4      # )+.)tuplemaprN   	partitionsplitrK   s   &rP   parse_mypy_versionr[   W   s/    S'++C0399#>?@@rR   builtins__builtins__c                (    V ^8  d   QhR\         RR/# )rJ   rK   rL   zTypingType[Plugin]rM   )rO   s   "rP   rQ   rQ   b   s      C 0 rR   c                    \         # )z
`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).
)PydanticPluginrZ   s   &rP   pluginrb   b   s
     rR   c                      a a ] tR t^lt oV3R lV 3R lltV3R lR ltV3R lR ltV3R lR ltV3R	 lR
 ltV3R lR lt	V3R lR lt
V3R lR ltV3R lR ltV3R lR ltRtVtV ;t# )ra   c                $   < V ^8  d   QhRS[ RR/# rJ   optionsrL   Nr+   )rO   __classdict__s   "rP   rQ   PydanticPlugin.__annotate__m   s     " " "D "rR   c                   < \        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__)selfrf   	__class__s   &&rP   rp   PydanticPlugin.__init__m   s4    1': ..668!rR   c                $   < V ^8  d   QhRS[ RR/# )rJ   fullnamerL   z+Optional[Callable[[ClassDefContext], None]]r_   )rO   rg   s   "rP   rQ   rh   r   s      C 4a rR   c                T   V P                  V4      pV'       d   \        VP                  \        4      '       do   \        ;QJ d0    R  VP                  P
                   4       F  '       g   K   RM%	  RM!! R  VP                  P
                   4       4      '       d   V P                  # R# )c              3   F   "   T F  p\        V4      \        8H  x  K  	  R # 5irj   )get_fullnameBASEMODEL_FULLNAME.0bases   & rP   	<genexpr>5PydanticPlugin.get_base_class_hook.<locals>.<genexpr>v   s     U<%);;   !TFN)lookup_fully_qualified
isinstancenoder(   anymro$_pydantic_model_class_maker_callbackrq   ru   syms   && rP   get_base_class_hook"PydanticPlugin.get_base_class_hookr   se    ))(3:chh11sUUsssUUUU@@@rR   c                L   < V ^8  d   QhRS[ RS[S[S[.R3,          ,          /# rJ   ru   rL   NrM   r   r   r.   )rO   rg   s   "rP   rQ   rh   z   s.      3 8HoEVX\E\<]3^ rR   c                4    V\         8X  d   V P                  # R # rj   )MODEL_METACLASS_FULLNAME)_pydantic_model_metaclass_marker_callbackrq   ru   s   &&rP   get_metaclass_hook!PydanticPlugin.get_metaclass_hookz   s    //AAArR   c                $   < V ^8  d   QhRS[ RR/# )rJ   ru   rL   z+Optional[Callable[[FunctionContext], Type]]r_   )rO   rg   s   "rP   rQ   rh      s      # 2_ rR   c                z    V P                  V4      pV'       d"   VP                  \        8X  d   V P                  # R # rj   )r   ru   FIELD_FULLNAME_pydantic_field_callbackr   s   && rP   get_function_hook PydanticPlugin.get_function_hook   s/    ))(33<<>1000rR   c                N   < V ^8  d   QhRS[ RS[S[S[.S[3,          ,          /# )rJ   ru   rL   )rM   r   r   r0   r   )rO   rg   s   "rP   rQ   rh      s-       =/SWBW9X0Y rR   c                @    VP                  R 4      '       d   \        # R# )z	.from_ormN)endswithfrom_orm_callbackr   s   &&rP   get_method_hookPydanticPlugin.get_method_hook   s    [))$$rR   c                L   < V ^8  d   QhRS[ RS[S[S[.R3,          ,          /# r   r   )rO   rg   s   "rP   rQ   rh      s.       (OK\^bKbBc9d rR   c                R    V\         8X  d   \        R8  d   \        P                  # R# )zpMark pydantic.dataclasses as dataclass.

Mypy version 1.1.1 added support for `@dataclass_transform` decorator.
N)   r   )DATACLASS_FULLNAMEMYPY_VERSION_TUPLEr4   dataclass_class_maker_callbackr   s   &&rP   get_class_decorator_hook'PydanticPlugin.get_class_decorator_hook   s$    
 )).@6.I===rR   c                <   < V ^8  d   QhRS[ RS[S[S[3,          /# rJ   ctxrL   )r2   r   rM   r   )rO   rg   s   "rP   rQ   rh      s$     ! !&9 !d38n !rR   c                    V P                   # )zZReturn all plugin config data.

Used by mypy to determine if cache needs to be discarded.
)rn   )rq   r   s   &&rP   report_config_data!PydanticPlugin.report_config_data   s    
    rR   c                $   < V ^8  d   QhRS[ RR/# rJ   r   rL   Nr.   )rO   rg   s   "rP   rQ   rh      s          D  rR   c                P    \        WP                  4      pVP                  4        R # rj   )PydanticModelTransformerrl   	transform)rq   r   transformers   && rP   r   3PydanticPlugin._pydantic_model_class_maker_callback   s    .s4F4FGrR   c                $   < V ^8  d   QhRS[ RR/# r   r   )rO   rg   s   "rP   rQ   rh      s      @ @_ @QU @rR   c                    V P                   P                  '       d   R# VP                  P                  P                  pV'       g   Q R4       h\        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.
Nz-callback not passed from 'get_metaclass_hook'dataclass_transform_spec)rl   debug_dataclass_transformclsinfodeclared_metaclassgetattrtyper   )rq   r   info_metaclasss   && rP   r   8PydanticPlugin._pydantic_model_metaclass_marker_callback   sd     77788NNN~>&&(BDII;?N8 JrR   c                $   < V ^8  d   QhRS[ RR/# )rJ   r   rL   r   )r/   )rO   rg   s   "rP   rQ   rh      s     3  3 O 3  3 rR   c                T   VP                   pVP                  ^ ,          R8X  g   Q R4       hVP                  ^,          R8X  g   Q R4       hVP                  ^ ,          pVP                  ^,          pV'       d+   V'       d#   \        VP                  VP
                  4       V# V'       d?   VP                  ^ ,          ^ ,          pV^ ,          p\        V\        4      '       g   V#  V# V'       Ed7   VP                  ^,          ^ ,          p\        V\        4      '       d7   \        R	8  d   VP                  ^ ,          pMVP                  4       ^ ,          p\        V\        4      '       d   \        VP                  4      p\        V\        4      '       d   VP                  '       d|   \         ;QJ d&    R VP                   4       F  '       d   K   RM	  RM! R VP                   4       4      '       d.   VP#                  V.\%        VP                  4      ,          R7      pV# V# )
aH  
Extract the type of the `default` argument from the Field function, and use it as the return type.

In particular:
* Check whether the default and default_factory argument is specified.
* Output an error if both are specified.
* Retrieve the type of the argument which is specified, and use it as return type for the function.
defaultz0"default" is no longer first argument in Field()default_factoryz9"default_factory" is no longer second argument in Field()c              3   B   "   T F  p\        V\        4      x  K  	  R # 5irj   )r   r@   )r{   args   & rP   r}   :PydanticPlugin._pydantic_field_callback.<locals>.<genexpr>   s     RMSJsK88Ms   FT)args)r   i  )default_return_typecallee_arg_namesr   +error_default_and_default_factory_specifiedapicontext	arg_typesr   r   r;   r   itemsr8   rB   ret_typer9   allcopy_modifiedlen)	rq   r   default_any_typedefault_argsdefault_factory_argsdefault_typedefault_argdefault_factory_typer   s	   &&       rP   r   'PydanticPlugin._pydantic_field_callback   s    22##A&)3g5gg3##A&*;;x=xx;xx{"xx{07M##==+A.L&q/K k<88## 94  / "!#&==#3A#6  .
;;%0+?+E+Ea+H( ,@+E+E+G+J(.==*+?+H+HIx22 RHMMRRHMMRRR  (55<L;MPST\TaTaPb;b5cHrR   )rn   rl   )__name__
__module____qualname____firstlineno__rp   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classcell__)rr   rg   s   @@rP   ra   ra   l   sp     " "
  
  
 ! !   @ @3  3  3 rR   ra   c                   T   a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R ltRtV t	R# )	rk   c                $   < V ^8  d   QhRS[ RR/# re   r+   )rO   rg   s   "rP   rQ   !PydanticPluginConfig.__annotate__   s     , , ,D ,rR   c                   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 # )NtoolrH   Fz/Configuration value must be a boolean for key: )fallback)config_file
parse_tomlget	__slots__r   bool
ValueErrorsetattrr   read
getbooleanCONFIGFILE_KEY)rq   rf   toml_configconfigkeysettingrl   s   &&     rP   rp   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+ &rR   c                6   < V ^8  d   QhRS[ S[S[3,          /# rJ   rL   r   rM   r   )rO   rg   s   "rP   rQ   r     s     C Cc3h CrR   c                V    V P                    Uu/ uF  q\        W4      bK  	  up# u upi rj   )r   r   )rq   r   s   & rP   rm   PydanticPluginConfig.to_data  s&    37>>B>CWT''>BBBs   &c                V   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   # )rJ   init_forbid_extra
init_typedwarn_required_dynamic_aliaseswarn_untyped_fieldsr   )r   )rO   rg   s   "rP   rQ   r      sF          $('     $# rR    N)r   r   r   r   r   )
r   r   r   r   r   rp   rm   __annotate_func__r   r   rg   s   @rP   rk   rk      s*     I, ,&C CC  rR   rk   c                0    V ^8  d   QhR\         R\        /# r   )r0   r   )rO   s   "rP   rQ   rQ     s     # #= #T #rR   c                   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                  R/ 4      P                  R4      pVRJd5   \!        \#        VP                   4      V P                  V P                  4       V P                  # )z+
Raise an error if orm_mode is not enabled
z
ctx.type: 
 (of type )r   orm_modeT)r   r   r>   itemr8   r   r9   rr   r   error_unexpected_behaviorr   r   r   metadatar   METADATA_KEYerror_from_ormget_name)r   ctx_type
model_typedetailpydantic_metadatar  s   &     rP   r   r     s   
 xxH(H%%==(L))j9J9JH.U.U&&
	Hh	'	'
hZz(2D2D2M2M1NaP!&''3;;?&&&"0044\B &&& $$Xr266zBHtx
0#''3;;G"""rR   c                   j  a  ] tR tRt o 0 R#mtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR lt]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R lR lt]V 3R lR l4       tV 3R  ltR!tV tR"# )$r   i  c                *   < V ^8  d   QhRS[ RS[RR/# )rJ   r   rl   rL   N)r.   rk   )rO   rg   s   "rP   rQ   %PydanticModelTransformer.__annotate__)  s$     + +O +<P +UY +rR   c                    Wn         W n        R # rj   _ctxrl   )rq   r   rl   s   &&&rP   rp   !PydanticModelTransformer.__init__)  s    	*rR   c                   < V ^8  d   QhRR/# rJ   rL   Nr   )rO   rg   s   "rP   rQ   r  -  s     
 
4 
rR   c                   V P                   pVP                  P                  pV P                  4        V P	                  4       pV P                  V4      p\        ;QJ d)    R VP                  RR  4       F  '       g   K   RM	  RM! R VP                  RR  4       4      pV P                  WCV4       V P                  V4       T P                  YCP                  RJ ;'       g    VP                  RJ R7       RV Uu/ uF  qfP                  VP                  4       bK  	  upRVP                  4       /VP                   \"        &   R# u upi )	ap  
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 allow_mutation = False or frozen = True
* stores the fields, config, and if the class is settings in the mypy metadata for access by subclasses
c              3   F   "   T F  p\        V4      \        8H  x  K  	  R # 5irj   )rx   BASESETTINGS_FULLNAMErz   s   & rP   r}   5PydanticModelTransformer.transform.<locals>.<genexpr>=  s     `R_$,t,0EER_r   NTF)frozenfieldsr   )r  r   r   adjust_validator_signaturescollect_configcollect_fieldsr   r   add_initializeradd_construct_method
set_frozenallow_mutationr  name	serializeset_values_dictr
  r  )rq   r   r   r   r   is_settingsfields   &      rP   r   "PydanticModelTransformer.transform-  s    iiww||((*$$&$$V,c`RVRZRZ[^\^R_`ccc`RVRZRZ[^\^R_``V[9!!&)'<'<'E'^'^Z^I^_&I&zz5??#44&If,,.'
l#Is   >#Ec                   < V ^8  d   QhRR/# r  r   )rO   rg   s   "rP   rQ   r  F  s     2 2T 2rR   c                   V P                   P                  P                  P                  P	                  4        F  w  r\        VP                  \        4      '       g   K'  VP                  P                  ^ ,          p\        V\        4      '       g   K\  \        VP                  \        4      '       g   K~  VP                  P                  \         R28X  g   K  RVP                  P                  n        K  	  R# )a3  When we decorate a function `f` with `pydantic.validator(...), 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()` call as a classmethod.
z.class_validators.validatorTN)r  r   r   namesr   r   r   r   original_decoratorsr   calleer    ru   
_NAMESPACEfuncis_class)rq   r)  r   	first_decs   &   rP   r"  4PydanticModelTransformer.adjust_validator_signaturesF  s     ++11779ID#((I..HH88;	y(33"9#3#3X>>!((11
|C^5__-1CHHMM* :rR   c                   < V ^8  d   QhRR/# )rJ   rL   ModelConfigDatar   )rO   rg   s   "rP   rQ   r  X  s       1 rR   c                   V P                   pVP                  p\        4       pVP                  P                   F  p\        V\        4      '       g   K  VP                  R8X  g   K.  VP                  P                   F;  p\        V\        4      '       g   K  VP                  V P                  V4      4       K=  	  VP                  '       g   K  VP                  '       d   K  V P                  P                  '       g   K  \        VP                   V4       K  	  VP"                  P$                  R,           F  p\&        VP(                  9  d   K  VP                   P+                  \-        \/        V4      4      4       VP(                  \&        ,          R,          P1                  4        F  w  rxVP3                  Wx4       K  	  K  	  V# )zj
Collects the values of the config attributes that are used by the plugin, accounting for parent classes.
Configr   NNr   )r  r   r:  defsbodyr   r   r)  r   updateget_config_updatehas_alias_generatorallow_population_by_field_namerl   r   error_required_dynamic_aliasesr   r   r   r  r
  add_plugin_dependencyr6   rx   r   
setdefault)	rq   r   r   r   stmtsubstmtr   r)  values	   &        rP   r#  'PydanticModelTransformer.collect_configX  sB    iigg "HHMMDdH--yyH$#yy~~G%g~>> MM$"8"8"AB  .
 ..."AAA**HHH2377DA " HHLL$$D4==0 GG))*?T@R*ST#}}\:8DJJL!!$.  M % rR   c                2   < V ^8  d   QhRRRS[ R,          /# )rJ   model_configr:  rL   PydanticModelFieldr   )rO   rg   s   "rP   rQ   r  w  s&     R R+< RFZA[ RrR   c                  a V P                   pV P                   P                  p. p\        4       pVP                  P                   EF  p\        V\        4      '       g   K  VP                  ^ ,          p\        V\        4      '       d   \        VP                  4      '       g   Kb  VP                  '       g3   V P                  P                  '       d   \        VP                  V4       VP                   P"                  P%                  VP                  4      pVf   K  VP&                  p	\        V	\(        4      '       d   K  \        V	\*        4      '       g   EK  V	P,                  '       d   EK-  V P/                  W6V4      p
V P1                  V4      w  rV'       dE   VP2                  '       g3   V P                  P4                  '       d   \7        VP                  V4       VP9                  \;        VP                  V
VVVP<                  VP>                  R7      4       VPA                  VP                  4       EK  	  VPC                  4       pVP                   PD                  R,           F  p\F        VPH                  9  d   K  . pVP                  PK                  \M        \O        V4      4      4       VPH                  \F        ,          R,          PQ                  4        Fw  w  opSV9  d;   \:        PS                  VV4      pVPA                  S4       VP9                  V4       KG  V3R lV 4       w  pVPU                  V4       VP9                  V4       Ky  	  W,           pK  	  V# )zB
Collects the fields for the model, accounting for parent classes
r)  is_requiredaliashas_dynamic_aliaslinecolumnr=  r   c              3   L   <"   T F  qP                   S8X  g   K  Vx  K  	  R # 5irj   )r)  )r{   ar)  s   & rP   r}   :PydanticModelTransformer.collect_fields.<locals>.<genexpr>  s     H:a4:s   $
$)+r  r   setr>  r?  r   r   lvaluesr    rF   r)  
new_syntaxrl   r   error_untyped_fieldsr   r   r1  r   r   r"   r*   is_classvarget_is_requiredget_alias_inforC  r   rD  appendrM  rT  rU  addcopyr   r  r
  rE  r6   rx   r   deserializeremove)rq   rL  r   r   r   known_fieldsrG  lhsr   r   rQ  rR  rS  
all_fieldsr   superclass_fieldsdatar-  r)  s   &&                @rP   r$  'PydanticModelTransformer.collect_fieldsw  s   
 iiiimmuHHMMDdN33,,q/Cc8,,N3884L4L???t'9'9'M'M'M$SWWd3
 ((..$$SXX.C{ 88D$00 dC((  ..s#>K'+':':4'@$E!$CCC&&DDD.sww=MM" +&7;;	 SXX&k "l [[]
HHLL$$D4==0 "GG))*?T@R*ST"mmL9(CIIK
d|+.::4FE $$T*%,,U3H:HHU%%e,%,,U3 L +7J# %$ rR   c                <   < V ^8  d   QhRS[ R,          RRRS[RR/# )rJ   r   rM  r   r:  r,  rL   Nr   r   )rO   rg   s   "rP   rQ   r    s8     D Dd+?&@ DJ[ Djn Dsw DrR   c                *   V P                   pV P                  P                  pVP                  RJpT;'       g/    \	        VP
                  ;'       d    VP                  '       * 4      pV P                  WWvR7      pV P                  W4      '       gD   \        R4      p	VP                  \        V	\        \        P                  4      R\        4      4       RVP                  P                   P"                  9  d   \%        VRV\'        4       4       R# R# )z
Adds a fields-aware `__init__` method to the class.

The added `__init__` will be annotated with types vs. all `Any` depending on the plugin settings.
Ttypedforce_all_optional	use_aliaskwargsNrp   )r  rl   r   rC  r   rB  get_field_argumentsshould_init_forbid_extrar*   r`  r   r7   r=   explicitr   r   r   r1  
add_methodr:   )
rq   r   r   r,  r   ro  rq  rp  init_argumentsvars
   &&&&      rP   r%  (PydanticModelTransformer.add_initializer  s     ii""--99E	( 
 
D&&TTv/T/T+T-
 114F 2 
 ,,V<<h-C!!(3	8J8J0KTS\"]^SWW\\///sJ
C 0rR   c                2   < V ^8  d   QhRS[ R,          RR/# )rJ   r   rM  rL   NrN  )rO   rg   s   "rP   rQ   r    s!     8
 8
40D+E 8
$ 8
rR   c           
        V P                   pVP                  P                  \         R2VP                  P                  \         R24      .4      p\	        V\        4       .4      p\        \        RV4      VR\        4      pV P                  VRRRR7      pV.V,           pVP                  P                  \         R24      pR	pVP                  P                  R
,           V,           p	\        R8  d   \        TT	\        R8  d)   \        RVP                  P                  R,           R7      M
\        R4      . V\        \         P"                  4      4      p
\%        VV	. V\        \         P"                  4      4      pM\'        WR. V4      p
\%        W. V4      p\)        \*        V4      VP                  P,                  P.                  V&   \1        V
\        4      '       d   T
pM\        V
4      p\3        VRVVVV
RR7       R# )z
Adds a fully typed `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.str_fields_setNTFrn  z.object_PydanticBaseModelrU   z
.construct)	namespace	construct)return_type	self_typetvar_defis_classmethod)r      )r      r!  )r  r   
named_typeBUILTINS_NAMErA   r:   r   r*   r   rs  r   ru   r   r@   r?   r7   r=   from_omitted_genericsr)   rG   r&   r   r   r1  r   rv  )rq   r   r   set_stroptional_set_strfields_set_argumentconstruct_argumentsobj_typeself_tvar_nametvar_fullnametvdself_tvar_exprr  s   &&           rP   r&  -PydanticModelTransformer.add_construct_method  s    ii''$$d%;cgg>P>PTaSbbfQg>h=ij$gxz%:;&s=:J'KM]_celm"66vT^cot6u236II77%%w&?@-((3.?' *W4 bCGG,<,<|,KL"2	778C )	778N ^BHMC(HUN-<T>-R>* c;''I#C(I!	
rR   c                8   < V ^8  d   QhRS[ R,          RS[RR/# )rJ   r   rM  r  rL   Nrl  )rO   rg   s   "rP   rQ   r    s-     G G&:!; GT Gd GrR   c                4   V P                   pVP                  P                  pV EFR  pVP                  P	                  VP
                  4      pVe   VP                  p\        V\        4      '       d	   W'n	        KW  \        V\        4      '       d9   VP                  P                  '       g   VP                  P                  4        K   \        V4      pRV RVP"                   R2p	\%        WP                  VP                  4       K  VP'                  VRR7      pWGn        W'n	        \)        V4      R,           \+        V4      ,           Vn        \/        \0        V4      VP                  \+        V4      &   EKU  	  R#   \         d    \!        T4      p Li ; i)z
Marks 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.
Nzsym_node.node: r  r  F)rq  rU   )r  r   r   r1  r   r)  r   r   r*   is_propertyr"   r   final_iterationdeferrM   	TypeErrorreprrr   r	  to_varrx   r  	_fullnamer&   r   )
rq   r   r  r   r   r-  sym_noderx  var_strr  s
   &&&       rP   r'  #PydanticModelTransformer.set_frozen  s(    iiww||Ezz~~ejj1H#mmc3''&,O_55cgg>U>U>UGGMMO,"%c(  /wiz#--PQRF-fggswwGll45l9"( ,T 2S 88C= H,;D#,F

8C=)/  % ,"&s),s   E>>FFc                4   < V ^8  d   QhRS[ RS[R,          /# )rJ   rH  rL   r:  )r   r   )rO   rg   s   "rP   rQ   r  <  s!       HEV<W rR   c                   VP                   ^ ,          p\        V\        4      '       d   VP                  V P                  9   g   R# VP                  R8X  d   \        VP
                  \        4      '       d   VP
                  P                  R8H  pMg\        VP
                  \        4      '       d   VP
                  P                  R8H  pM-\        VP                  V P                  P                  V4       R# \        VR7      # VP                  R8X  dL   Rp\        VP
                  \        4      '       d   VP
                  P                  R8X  d   Rp\        VR	7      # \        VP
                  \        4      '       dJ   VP
                  P                  R9   d/   \        R/ VP                  VP
                  P                  R
8H  /B # \        VP                  V P                  P                  V4       R# )z
Determines the config update due to a single statement in the Config class 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extraforbid)forbid_extraalias_generatorTzbuiltins.NoneF)rB  builtins.True)r  zbuiltins.Falser   )rZ  r   r    r)  tracked_config_fieldsrvaluer$   rI  r   error_invalid_config_valuer  r   r:  ru   )rq   rH  rf  r  rB  s   &&   rP   rA  *PydanticModelTransformer.get_config_update<  s[    ooa 3))chh$:T:T.T88w'..'22&~~33x?GNNJ77&~~22h>*388TYY]]GL"==88(("&'..(338O8OSb8b&+#"7JKKgnnh//GNN4K4KOr4r"\chh0G0G?0Z%[\\"388TYY]]GDrR   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# )rJ   r   rG  rf  rL   )r   r   r    r   )rO   rg   s   "rP   rQ   r  Y  s)     . .X .^ .( .t .rR   c                   VP                   p\        V\        4      '       dK   \        V P                  VP
                  ,          P                  4      p\        P                  V4      '       * # \        V\        4      '       d   \        VP                  \        4      '       d   VP                  P                  \        8X  d   \        VP                  VP                   4       F.  w  rVVe   VR8X  d   VP"                  \$        J u # VR8X  g   K-   R# 	  \        V P                  VP
                  ,          P                  4      p\        P                  V4      '       * # \        V\$        4      # )zW
Returns a boolean indicating whether the field defined in `stmt` is a required field.
r   r   F)r  r   r'   rB   r   r)  r   r   type_has_implicit_defaultr   r3  r#   ru   r   zipr   	arg_namesrr   r   )r   rG  rf  expr
value_typer   r)  s   &&&    rP   r^  (PydanticModelTransformer.get_is_requiredX  s    
 {{dH%%(#(();)@)@AJ/II*UUUdH%%*T[['*J*Jt{{OcOcguOu !DNN;	<49#4==L88,,  < )#(();)@)@AJ/II*UUU$--rR   c                6   < V ^8  d   QhRS[ S[,          RS[/# )rJ   type_rL   )r   r<   r   )rO   rg   s   "rP   rQ   r  s  s       *)= $ rR   c                   \        V \        4      '       d   R# \        V \        4      '       dQ   \        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      '       d   R# R# )z
Returns True if the passed type will be given an implicit default value.

In pydantic v1, this is the case for Optional types and Any (with default value None).
Tc              3   r   "   T F-  p\        V\        4      ;'       g    \        V\        4      x  K/  	  R # 5irj   )r   r:   r7   )r{   r  s   & rP   r}   EPydanticModelTransformer.type_has_implicit_default.<locals>.<genexpr>|  s-      0
P[JtX&CC*T7*CCP[s   77F)r   r7   rA   r   r   )r  s   &rP   r  2PydanticModelTransformer.type_has_implicit_defaultr  sc     eW%%eY''CC 0
PUP[P[0
CCC 0
PUP[P[0
 -
 -
 rR   c                L   < V ^8  d   QhRS[ RS[S[S[,          S[3,          /# )rJ   rG  rL   )r   r
   r   rM   r   )rO   rg   s   "rP   rQ   r    s)      ^ hsmT6I0J rR   c                   V P                   p\        V\        4      '       d   R# \        V\        4      '       d@   \        VP                  \
        4      '       d    VP                  P                  \        8X  g   R# \        VP                  4       FI  w  r#VR8w  d   K  VP                  V,          p\        V\        4      '       d   VP                  R3u # Ru # 	  R# )a   
Returns 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.
FrR  )NF)NT)r  r   r'   r   r3  r#   ru   r   	enumerater  r   r$   rI  )rG  r  iarg_namer   s   &    rP   r_  'PydanticModelTransformer.get_alias_info  s     {{dH%% tX&&:dkk7+K+KPTP[P[PdPdhvPv $T^^4KA7"))A,C#w''yy%''!! 5 rR   c                V   < V ^8  d   QhRS[ R,          RS[RS[RS[RS[ S[,          /# )rJ   r   rM  ro  rp  rq  rL   )r   r   r   )rO   rg   s   "rP   rQ   r    s?      /09=SWdh	hrR   c           
         V P                   P                  P                  pV Uu. uF2  pV'       d   VP                  '       d   K  VP	                  WRW4R7      NK4  	  ppV# u upi )z
Helper function used during the construction of the `__init__` and `construct` method signatures.

Returns a list of mypy Argument instances for use in the generated signatures.
)ro  force_optionalrq  )r  r   r   rS  to_argument)rq   r   ro  rp  rq  r   r-  	argumentss   &&&&&   rP   rs  ,PydanticModelTransformer.get_field_arguments  se     yy}}!!  
%"9"9 iEd@Rh 	 

 
s   A!A!A!c                8   < V ^8  d   QhRS[ R,          RRRS[/# )rJ   r   rM  r   r:  rL   rl  )rO   rg   s   "rP   rQ   r    s*     4 4t4H/I 4Sd 4im 4rR   c                    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)rC  is_dynamic_alias_presentr   rB  r  rl   r   )rq   r   r   s   &&&rP   rt  1PydanticModelTransformer.should_init_forbid_extra  sR     444,,VT&:T:T5UVV!!333rR   c                :   < V ^8  d   QhRS[ R,          RS[RS[/# )rJ   r   rM  rB  rL   rl  )rO   rg   s   "rP   rQ   r    s*      .B)C Z^ cg rR   c                    V  F  pVP                   '       g   K   R# 	  V'       d   V  F  pVP                  e   K   R# 	  R# )z
Returns whether any fields on the model have a "dynamic alias", i.e., an alias that cannot be
determined during static analysis.
TF)rS  rR  )r   rB  r-  s   && rP   r  1PydanticModelTransformer.is_dynamic_alias_present  s>     E&&&  ;;&   rR   c                6   < V ^8  d   Qh/ S[ S[,          ;R&   # )rJ   r  )r	   rM   )rO   rg   s   "rP   rQ   r    s     s8  rR   r  N>   r  r  r  r(  r  rC  )r   r   r   r   r  rp   r   r"  r#  r$  r%  r&  r'  rA  staticmethodr^  r  r_  rs  rt  r  r  r   r   r  s   @rP   r   r     s     '+ +
 
22 2$ >R RhD D,8
 8
tG GB 8 . .2     8  4 4  A  rR   r   c                      a  ] tR tRt o V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 lt]V 3R
 lR l4       t	Rt
V tR# )rM  i  c                N   < V ^8  d   QhRS[ RS[RS[S[ ,          RS[RS[RS[/# )rJ   r)  rQ  rR  rS  rT  rU  )rM   r   r   rN   )rO   rg   s   "rP   rQ   PydanticModelField.__annotate__  sA      &*3;C=UYadnqrR   c                N    Wn         W n        W0n        W@n        WPn        W`n        R # rj   rP  )rq   r)  rQ  rR  rS  rT  rU  s   &&&&&&&rP   rp   PydanticModelField.__init__  s$     	&
!2	rR   c                ,   < V ^8  d   QhRS[ RS[RS[/# )rJ   r   rq  rL   )r(   r   r*   )rO   rg   s   "rP   rQ   r    s"     / /8 / / /rR   c                    V P                   pV'       d   V P                  e   V P                  p\        W1V P                   ,          P                  4      # rj   )r)  rR  r*   r   )rq   r   rq  r)  s   &&& rP   r  PydanticModelField.to_var  s9    yy/::D4dii--..rR   c          
      8   < V ^8  d   QhRS[ RS[RS[RS[RS[/# )rJ   r   ro  r  rq  rL   )r(   r   r   )rO   rg   s   "rP   rQ   r    s2     

 

 

 

t 

X\ 

ai 

rR   c                H   V'       d<   WP                   ,          P                  e   WP                   ,          P                  pM\        \        P                  4      p\        V P                  W4      TR V'       g   V P                  '       g   \        R7      # \        R7      # )N)variabletype_annotationinitializerkind)
r)  r   r7   r=   ru  r   r  rQ  r   r   )rq   r   ro  r  rq  r  s   &&&&& rP   r  PydanticModelField.to_argument  sw    T))_))5"99o22O%i&8&89O[[1+"08H8H8H	
 	
 OX	
 	
rR   c                    < V ^8  d   QhRS[ /# r   )r   )rO   rg   s   "rP   rQ   r    s      8 rR   c                    V P                   # rj   )__dict__)rq   s   &rP   r*  PydanticModelField.serialize  s    }}rR   c                *   < V ^8  d   QhRS[ RS[RR/# )rJ   r   ri  rL   rM  )r(   r   )rO   rg   s   "rP   rQ   r    s#      x x <P rR   c                    V ! R/ VB # )Nr   r   )r   r   ri  s   &&&rP   rc  PydanticModelField.deserialize  s    {T{rR   )rR  rU  rS  rQ  rT  r)  N)r   r   r   r   rp   r  r  r*  classmethodrc  r   r   r  s   @rP   rM  rM    sA      / /

 

   rR   rM  c                   l   a  ] tR tRt o RV 3R lR lltV 3R lR ltV 3R lR ltV 3R	 lR
 ltRtV t	R# )r:  i  Nc                   < V ^8  d   QhRS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          /# )rJ   r  r(  r  r  rC  rB  )r   r   )rO   rg   s   "rP   rQ   ModelConfigData.__annotate__  s_     7 7tn7 !7 	7
 4.7 )17 &d^7rR   c                N    Wn         W n        W0n        W@n        WPn        W`n        R # rj   )r  r(  r  r  rC  rB  )rq   r  r(  r  r  rC  rB  s   &&&&&&&rP   rp   ModelConfigData.__init__  s&     ), .L+#6 rR   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )rO   rg   s   "rP   rQ   r    s     I Ic3h IrR   c                v    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 rj   )r  r   )rq   kvs   &  rP   r+  ModelConfigData.set_values_dict  s1    !%!4!4!6H!6!!6HHHs   55c                2   < V ^8  d   QhRS[ R,          RR/# )rJ   r   r:  rL   N)r   )rO   rg   s   "rP   rQ   r    s!        X&78  T  rR   c                x    Vf   R # VP                  4       P                  4        F  w  r#\        WV4       K  	  R # rj   )r+  r   r   )rq   r   r  r  s   &&  rP   r@  ModelConfigData.update  s2    >**,224DADQ 5rR   c                *   < V ^8  d   QhRS[ RS[RR/# )rJ   r   rI  rL   N)rM   r   )rO   rg   s   "rP   rQ   r    s"     & &c &# &$ &rR   c                <    \        W4      f   \        WV4       R # R # rj   )r   r   )rq   r   rI  s   &&&rP   rF  ModelConfigData.setdefault  s    4%Du% &rR   )r(  rC  r  r  rB  r  )NNNNNN)
r   r   r   r   rp   r+  r@  rF  r   r   r  s   @rP   r:  r:    s/     7 7 I I   & &rR   r:  zpydantic-ormzInvalid from_orm callPydanticzpydantic-configzInvalid config valuezpydantic-aliaszDynamic alias disallowedzpydantic-unexpectedzUnexpected behaviorzpydantic-fieldzUntyped field disallowedzInvalid Field defaultsc                @    V ^8  d   QhR\         R\        R\        RR/# )rJ   
model_namer   r   rL   N)rM   r-   r   )rO   s   "rP   rQ   rQ     s0     U Us U)? U' UVZ UrR   c                 >    VP                  R V  R2V\        R7       R# )"z" does not have orm_mode=TruecodeN)fail	ERROR_ORM)r  r   r   s   &&&rP   r  r    s    HHq9:G)HTrR   c                @    V ^8  d   QhR\         R\        R\        RR/# )rJ   r)  r   r   rL   N)rM   r3   r   )rO   s   "rP   rQ   rQ     s1     O OS O/N OY` Oei OrR   c                 >    VP                  R V  R2V\        R7       R# )zInvalid value for "Config.r  r  N)r  ERROR_CONFIG)r)  r   r   s   &&&rP   r  r    s    HH)$q17HNrR   c                4    V ^8  d   QhR\         R\        RR/# rJ   r   r   rL   Nr3   r   )rO   s   "rP   rQ   rQ   "  s)     O O(G ORY O^b OrR   c                 6    V P                  R V\        R7       R# )z#Required dynamic aliases disallowedr  N)r  ERROR_ALIASr   r   s   &&rP   rD  rD  "  s    HH2G+HNrR   c                b    V ^8  d   QhR\         R\        \        \        3,          R\        RR/# )rJ   r  r   r   rL   N)rM   r   r-   r3   r   )rO   s   "rP   rQ   rQ   &  s8     ; ;;24SST;_f;	;rR   c                 ^    R pRV  R2pVRV R2,          pVP                  WB\        R7       R# )z6https://github.com/pydantic/pydantic/issues/new/choosez7The pydantic mypy plugin ran into unexpected behavior: 
z&Please consider reporting this bug at z so we can try to fix it!r  N)r  ERROR_UNEXPECTED)r  r   r   linkfull_messages   &&&  rP   r	  r	  &  s?     DDLVHTVWL<TFB[\\LHH\)9H:rR   c                4    V ^8  d   QhR\         R\        RR/# r  r  )rO   s   "rP   rQ   rQ   0  s(     G G= G GTX GrR   c                 6    V P                  R V\        R7       R# )zUntyped fields disallowedr  N)r  ERROR_UNTYPEDr  s   &&rP   r\  r\  0  s    HH('HFrR   c                4    V ^8  d   QhR\         R\        RR/# r  )r-   r   )rO   s   "rP   rQ   rQ   4  s)     s s5K sV] sbf srR   c                 6    V P                  R V\        R7       R# )z>Field default and default_factory cannot be specified togetherr  N)r  ERROR_FIELD_DEFAULTSr  s   &&rP   r   r   4  s    HHMw]qHrrR   c                    V ^8  d   QhR\         R\        R\        \        ,          R\        R\
        \        ,          R\
        \        ,          R\        R\        R	R
/	# )rJ   r   r)  r   r  r  r  r  is_newrL   N)r.   rM   r   r   r   r   rG   r   )rO   s   "rP   rQ   rQ   8  sz     P% P%	P%
P% x.P% 	P%
 ~P% z"P% P% P% 
P%rR   c           	        V P                   P                  pWP                  9   d   VP                  V,          p	V	P                  '       dZ   \	        V	P
                  \        4      '       d:   V P                   P                  P                  P                  V	P
                  4       T;'       g    \        V4      pV'       g	   V'       d2   \        \        R4      \        P                  ! V4      R\        4      .p
M1T;'       g    \        V4      p\        \        R4      VR\        4      .p
W,           p. . . rpV Fv  pVP                   '       g   Q R4       hVP#                  VP                   4       VP#                  \%        VP&                  4      4       VP#                  VP(                  4       Kx  	  V P*                  P-                  \.         R24      p\1        YYY'       d   V.MRR7      p\        W\3        \5        4       .4      4      pVVn        \7        VV4      Vn        VVn        \=        V4      R,           V,           Vn        VP@                  Vn         WP                  9   d6   \C        WP                  4      pVP                  V,          VP                  V&   V'       dv   RVn"        \        VVP8                  4      pVVn        VP>                  Vn        RVn#        \I        V\K        R	4      .V4      pVP@                  Vn         \M        \N        V4      p	M\M        \N        V4      p	RV	n        WP                  V&   VPP                  P                  P                  P#                  V4       R# )
zq
Adds a new method to a class.

This can be dropped if/when https://github.com/python/mypy/issues/7301 is merged
_clsN__pydantic_self__z"All arguments must be fully typed.z	.function)	variablesrU   Tr  ))r   r   r1  plugin_generatedr   r   r   r>  r?  rd  rC   r   r*   r>   make_normalizedr   r  r`  r  r  r  r   r  r  r8   r   r!   r5   r   r6  rx   r  rT  rD   is_decoratedr  r   r    r&   r   defn)r   r)  r   r  r  r  r  r  r   r   firstr   r  	arg_kindsr   function_type	signaturer5  r_namer  decs   &&&&&&&&             rP   rv  rv  8  s     77<<D zzjjJsxx$A$AGGLL$$SXX.00]40I#f+x'?'?	'JDRYZ[ 44t!4	#12ItWMN<D&("b)I"""H$HH",,-#,,/0"	  GG&&-	'BCMim]ePXzkoI 4uhj\23DDI!)T2DI"DM!$'#-4DN		DI zz-dJJ?!ZZ-

6 dii nnx67;
 99dC(dD)CJJtIINNt$rR   c                R    V ^8  d   QhR\         \        \        3,          R\        /# rJ   xrL   r   r   r%   rM   )rO   s   "rP   rQ   rQ     s$      E(J./ C rR   c                N    V P                   p\        V4      '       d   V! 4       # V# z[
Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped.
)ru   callabler$  fns   & rP   rx   rx     s"     
B||tIrR   c                R    V ^8  d   QhR\         \        \        3,          R\        /# r#  r%  )rO   s   "rP   rQ   rQ     s$      h
*+  rR   c                N    V P                   p\        V4      '       d   V! 4       # V# r'  )r)  r(  r)  s   & rP   r  r    s"     
B||tIrR   c                h    V ^8  d   QhR\         R\        \        \         \        3,          ,          /# )rJ   r   rL   )rM   r   r   r   )rO   s   "rP   rQ   rQ     s'      C HT#s(^$< rR   c                 |   V P                  R 4      '       g   R# Rp\        P                  R8  d   ^ RIpM ^ RIp\        W4      ;_uu_ 4       pVP                  V4      uuRRR4       #   \
         d3    Rp ^ RIp LC  \
         d    ^ RIpTP                  R4         R# i ; ii ; i  + '       g   i     R# ; i)z.tomlNrbrzJNo TOML parser installed, cannot read configuration from `pyproject.toml`.)   r  )r   sysversion_infotomllibtomliImportErrortomlwarningswarnopenload)r   	read_modetoml_r8  rfs   &    rP   r   r     s    ((I
7"	! 
k	%	%zz"~ 
&	%  		I$ jk			 
&	%	%s5   A* B**B'8A>> B#B'"B##B'*B;	)r   i  )NNFF)yr2  configparserr   typingr   r   r   r   r   r	   r
   r   
TypingTyper   mypy.errorcodesr   
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*   mypy.optionsr,   mypy.pluginr-   r.   r/   r0   r1   r2   r3   mypy.pluginsr4   mypy.semanalr5   mypy.server.triggerr6   
mypy.typesr7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   mypy.typevarsrC   	mypy.utilrD   mypy.versionrE   mypy_versionpydantic.v1.utilsrF   rG   r6  r   r  r   r4  ry   r  r   r   r   r[   r   r  rb   ra   rk   r   r   rM  r:  r  r  r  r	  r  r  r  r  rD  r	  r\  r   rv  rx   r  r   r   rR   rP   <module>rP     s   
 % ] ] ] %       > !   % * 5    ( 2 4 ,5%
 !'cr]
"|?3 %,&@A (\)=> <}-"|#9: A (5 0H<
. r V r j"C "CJ#2l l^" "J& &> n&=zJ	*,BJO(*DjQ24I:V *,F
S !13KZX UOO;GsP%fm  5445s   G GG