
    h                       S r SSKJr  SSKrSSKJr  SSKJr  SSKJ	r	J
r
Jr  SSKJr  SSKJrJr  SS	KJrJrJrJrJrJrJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1  SS
K2J3r3  SSK4J5r5J6r6J7r7J8r8J9r9J:r:  SSK;J<r<  SSK=J>r>  SSK?J@r@  SSKAJBrB  SSKCJDrD  SSKEJFrF  SSKGJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrPJQrQ  SSKRJSrS  SSKTJUrU  SSKVJWrX  SSKYJZrZ  SSK[J\r\  Sr]Sr^Sr_Sr`SraSrbSrcSrdS re1 S!krf\fS"1-
  rg\\" \X5      rhS#riS$rWSKS% jrj " S& S'\85      rk " S( S)5      rlSLS* jrm " S+ S,5      rn " S- S.5      ro " S/ S05      rp " S1 S2\D5      rq " S3 S45      rrSMS5 jrs\" S6S7S85      rt\" S9S:S85      ru\" S;S<S85      rv\" S=S>S85      rw\" S?S@S85      rx\" S?SAS85      ry\" S?SBS85      rzSNSC jr{SOSD jr|SPSE jr}        SQSF jr~SPSG jrSRSH jr   SS                 STSI jjrSUSJ jrg)Vz^This module includes classes and functions designed specifically for use with the mypy plugin.    )annotationsN)Iterator)ConfigParser)AnyCallablecast)	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_validator>   *pydantic.functional_serializers.serializer.pydantic.deprecated.class_validators.validator.pydantic.functional_validators.field_validatorrI   0pydantic.functional_serializers.model_serializer3pydantic.deprecated.class_validators.root_validatorrM   builtins   c                    [         $ )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)versions    ?/var/www/html/env/lib/python3.13/site-packages/pydantic/mypy.pypluginrU   m   s
         c                  l   ^  \ rS rSrSrSU 4S jjrSS jrSS jrSS jrSS jr	SS jr
SS	 jrS
rU =r$ )rR   |   zThe Pydantic mypy plugin.c                   > [        U5      U l        U R                  R                  5       U l        [        TU ]  U5        g N)PydanticPluginConfigplugin_configto_data_plugin_datasuper__init__)selfoptions	__class__s     rT   r`   PydanticPlugin.__init__   s4    1': ..668!rV   c                    U R                  U5      nU(       aO  [        UR                  [        5      (       a0  UR                  R	                  [
        5      (       a  U R                  $ g)zUpdate Pydantic model class.N)lookup_fully_qualified
isinstancenoder*   has_baseBASEMODEL_FULLNAME$_pydantic_model_class_maker_callback)ra   fullnamesyms      rT   get_base_class_hook"PydanticPlugin.get_base_class_hook   sJ    ))(3:chh11xx  !344@@@rV   c                0    U[         :X  a  U R                  $ g)z,Update Pydantic `ModelMetaclass` definition.N)MODEL_METACLASS_FULLNAME)_pydantic_model_metaclass_marker_callbackra   rl   s     rT   get_metaclass_hook!PydanticPlugin.get_metaclass_hook   s    //AAArV   c                <    UR                  S5      (       a  [        $ g)z-Adjust return type of `from_orm` method call.z	.from_ormN)endswithfrom_attributes_callbackrs   s     rT   get_method_hookPydanticPlugin.get_method_hook   s    [))++rV   c                    U R                   $ )zZReturn all plugin config data.

Used by mypy to determine if cache needs to be discarded.
)r^   )ra   ctxs     rT   report_config_data!PydanticPlugin.report_config_data   s    
    rV   c                    [        UR                  UR                  UR                  U R                  5      nUR                  5         g rZ   )PydanticModelTransformerclsreasonapir\   	transform)ra   r|   transformers      rT   rk   3PydanticPlugin._pydantic_model_class_maker_callback   s0    .sww

CGGTM_M_`rV   c                    U R                   R                  (       a  gUR                  R                  R                  nU(       d   S5       e[        UR                  SS5      (       a  SUR                  l        gg)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)r\   debug_dataclass_transformr   infodeclared_metaclassgetattrtyper   )ra   r|   info_metaclasss      rT   rr   8PydanticPlugin._pydantic_model_metaclass_marker_callback   sa     7788NNN~>&&(BDII;?N8 JrV   )r^   r\   rb   r,   returnNone)rl   strr   z(Callable[[ClassDefContext], None] | None)rl   r   r   z&Callable[[MethodContext], Type] | None)r|   r1   r   dict[str, Any])r|   r.   r   r   )__name__
__module____qualname____firstlineno____doc__r`   rn   rt   ry   r}   rk   rr   __static_attributes____classcell__rc   s   @rT   rR   rR   |   s0    #"
! @ @rV   rR   c                  Z    \ rS rSr% SrSrS\S'   S\S'   S\S'   S\S'   SS	 jrSS
 jrSr	g)r[      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   boolr   r   r   r   c                   UR                   c  g [        UR                   5      nUbw  UR                  S0 5      R                  S0 5      nU R                   HD  nUR                  US5      n[	        U[
        5      (       d  [        SU 35      e[        XU5        MF     g [        5       nUR                  UR                   5        U R                   H$  nUR                  [        USS9n[        XU5        M&     g )NtoolrH   Fz/Configuration value must be a boolean for key: )fallback)config_file
parse_tomlget	__slots__rg   r   
ValueErrorsetattrr   read
getbooleanCONFIGFILE_KEY)ra   rb   toml_configconfigkeysettingr\   s          rT   r`   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+ &rV   c                X    U R                    Vs0 s H  o[        X5      _M     sn$ s  snf )z/Returns a dict of config names to their values.)r   r   )ra   r   s     rT   r]   PydanticPluginConfig.to_data   s&    37>>B>CWT''>BBBs   ' Nr   r   r   )
r   r   r   r   r   r   __annotations__r`   r]   r   r   rV   rT   r[   r[      s3    I #''##,&CrV   r[   c                >   U R                   n[        U[        5      (       a  UR                  n[        U[        5      (       a,  [        UR
                  [        5      (       a  UR
                  nOa[        U[        5      (       a  UnOISU SUR                  R                   S3n[        X0R                  U R                  5        U R                  $ UR                   R                  R                  [        5      nUc  U R                  $ UR                   R!                  ["        5      (       d  U R                  $ UR                  S0 5      R                  S5      nUSLa5  [%        UR                   R&                  U R                  U R                  5        U R                  $ )z1Raise an error if from_attributes is not enabled.z
ctx.type: 
 (of type )r   from_attributesT)r   rg   r?   itemr:   ret_typer;   rc   r   error_unexpected_behaviorr   contextdefault_return_typemetadatar   METADATA_KEYri   rj   error_from_attributesname)r|   ctx_type
model_typedetailpydantic_metadatar   s         rT   rx   rx      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"""rV   c                      \ rS rSrSr                    SS jr                  SS jr  S         SS jjr S         SS jjrSS jr	\
SS j5       rSS	 jrS
rg)PydanticModelField   z5Based on mypy.plugins.dataclasses.DataclassAttribute.c                |    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        Xl	        g rZ   )
r   alias	is_frozenhas_dynamic_aliashas_defaultstrictlinecolumnr   r   )ra   r   r   r   r   r   r   r   r   r   r   s              rT   r`   PydanticModelField.__init__   s8     	
"!2&			rV   c	                J   U R                  XXW5      n	U R                  c  UOU R                  n
U(       d  U
(       a  U R                  XSS9nO[        [        R
                  5      n[        U	USU(       a  [        S9$ U(       d  U R                  (       a  [        S9$ [        S9$ )zABased on mypy.plugins.dataclasses.DataclassAttribute.to_argument.NT)include_root_type)variabletype_annotationinitializerkind)to_varr   r
   r9   r>   explicitr   r   r   r   r   )ra   current_infotypedmodel_strictforce_optional	use_aliasr   force_typevars_invariantis_root_model_rootr   r   r   s               rT   to_argumentPydanticModelField.to_argument  s     ;;|)V!%!4$++F"..|TX.YO%i&8&89O+! 	
 	
 $2T5E5E-
 	
 LU
 	
rV   c                   U(       aJ  [        U R                  [        5      (       a+  U R                  R                  5       n[        Ul        XPl        U R                  GbV  U R                  R                  Gb>  [        R                  " UR                  R                  5         [        U5      n[        U[        5      (       d   eU(       a5  UR                   H%  n[        U[        5      (       d  M  [        Ul        M'     [        U R                  U R                  R                  R                   U05      nU(       am  [        U[        5      (       aX  [#        UR                  5      (       a>  [%        [&        UR                  S   R                  5      n	[)        X5      n
[+        X/5      nUsSSS5        $ U R                  $ ! , (       d  f       U R                  $ = f)zABased on mypy.plugins.dataclasses.DataclassAttribute.expand_type.Nroot)rg   r   r@   copy_modifiedr   variancer   	self_typer6   strict_optional_setrb   strict_optionalrC   r;   argsr
   idis_root_modelr   r=   r   rA   )ra   r   r   r   r   modified_typefilled_with_typevarsargexpanded_type	root_typeexpanded_root_types              rT   r
   PydanticModelField.expand_type2  s`    $
 $))[11 $		 7 7 9)2&)	99 TYY%8%8%D
 **3;;+F+FG'4\'B$!"6AAAA+388%c;77+4CL  9 !,DII		8K8K8N8NPd7e f$M8)L)LQ^_l_q_qQrQr !%T=+=+=f+E+J+J KI)@)Z&$-}.Q$RM$! HG" yy# HG" yys   "AG2B:G
Gc                    U(       a  U R                   b  U R                   nOU R                  n[        XPR                  XU5      5      $ )z<Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.)r   r   r+   r
   )ra   r   r   r   r   r   s         rT   r   PydanticModelField.to_var\  s;     /::D99D4)),=UVWWrV   c           
        U R                   (       d   eU R                  U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                   R                  5       S.	$ )?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ra   s    rT   r   PydanticModelField.serializek  sd    yyyIIZZ!%!7!7++kkIIkkII'')

 
	
rV   c                l    UR                  5       n[        UR                  S5      U5      nU " SXAS.UD6$ )ABased on mypy.plugins.dataclasses.DataclassAttribute.deserialize.r   )r   r   r   )copyr3   pop)r   r   datar   typs        rT   deserializePydanticModelField.deserializez  s7     yy{(&)93?//$//rV   c                    U R                   bY  [        R                  " UR                  R                  5         [        U R                   XR                  5      U l         SSS5        gg! , (       d  f       g= f)zhExpands type vars in the context of a subtype when an attribute is inherited
from a generic super type.
N)r   r6   r   rb   r   r8   r   )ra   sub_typer   s      rT   expand_typevar_from_subtype.PydanticModelField.expand_typevar_from_subtype  sQ     99 **3;;+F+FG3DIIxS	 HG !GGs   &A((
A6)
r   r   r   r   r   r   r   r   r   r   N)r   r   r   z
str | Noner   r   r   r   r   r   r   bool | Noner   intr   r  r   Type | Noner   r*   )r   r*   r   r   r   r   r   r   r   r   r   r2   r   r   r   r   r   r   )FF)
r   r*   r   r2   r   r   r   r   r   r  F)
r   r*   r   r2   r   r   r   r   r   r+   r   r   )r   r*   r  r   r   r2   r   r   )r  r*   r   r2   r   r   )r   r   r   r   r   r`   r   r
   r   r   classmethodr  r	  r   r   rV   rT   r   r      sg   ?  	
        0

 
 	

 
 
 -
 #'
 !
 

B */"'(( -( #'	(
  ( 
(^ */XX -X 	X
 #'X 
X
 0 0TrV   r   c                  <    \ rS rSrSrS r\SS j5       rS	S jrSr	g)
PydanticModelClassVari  zBased on mypy.plugins.dataclasses.DataclassAttribute.

ClassVars are ignored by subclasses.

Attributes:
    name: the ClassVar name
c                    Xl         g rZ   r   )ra   r   s     rT   r`   PydanticModelClassVar.__init__  s    	rV   c                2    UR                  5       nU " S0 UD6$ )r   r   )r  )r   r  s     rT   r  !PydanticModelClassVar.deserialize  s     yy{{T{rV   c                    SU R                   0$ )r   r   r  r   s    rT   r   PydanticModelClassVar.serialize  s     DII
 	
rV   r  N)r  r   r   r  r  )
r   r   r   r   r   r`   r  r  r   r   r   rV   rT   r  r    s%      

rV   r  c                     \ rS rSr% Sr1 SkrS\S'             SS jrSS jrSS jr	SS	 jr
      S S
 jrS!S jrS"S jr        S#S jrS$S jr          S%S jr          S%S jrS&S jrS'S(S jjr\S)S j5       r\S*S j5       r\S+S j5       r\S)S j5       r S'                 S,S jjrS-S jr\S.S j5       rSrg)/r   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.
>   extrafrozenr   alias_generatorr   populate_by_namevalidate_by_namevalidate_by_aliaszset[str]tracked_config_fieldsc                4    Xl         X l        X0l        X@l        g rZ   )_cls_reason_apir\   )ra   r   r   r   r\   s        rT   r`   !PydanticModelTransformer.__init__  s     		*rV   c                   U R                   R                  n[        U5      nU R                  5       nU R	                  X25      u  pEUb  Uc  gU H  nUR
                  b  M    g   UR                  [        5      nU R                  XCXr5        U R                  XCXr5        U R                  X@R                  UR                  SL S9  U R                  5         U Vs0 s H  ofR                  UR                  5       _M     snU Vs0 s H  oR                  UR                  5       _M     snUR!                  5       S.UR"                  [$        '   gs  snf s  snf )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)r  )fields
class_varsr   )r#  r   r   collect_configcollect_fields_and_class_varsr   ri   BASESETTINGS_FULLNAMEadd_initializeradd_model_construct_method
set_frozenr%  r  adjust_decorator_signaturesr   r   get_values_dictr   r   )	ra   r   is_a_root_modelr   r(  r)  fieldis_settings	class_vars	            rT   r   "PydanticModelTransformer.transform  s,    yy~~'-$$&!??X>Z/Ezz!  mm$9:V[J''U		&--42GH((* CII&zz5??#44&IR\]R\Y>>9+>+>+@@R\],,.'
l#  J]s   $E$Ec                d  ^ U R                   R                  R                  R                  5        H  n[	        UR
                  [        5      (       d  M$  UR
                  R                  S   m[	        T[        5      (       d  MT  [	        TR                  [        5      (       d  Mu  TR                  R                  [        ;   d  M  TR                  R                  [        :X  a/  [        U4S j[        TR                   5       5       5      (       a  M  SUR
                  R"                  l        M     g)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`.
r   c              3     >#    U  HF  u  pTR                   U   S :H  =(       a&    [        U[        5      =(       a    UR                  S:H  v   MH     g7f)modeafterN)	arg_namesrg   r&   value).0ir   	first_decs      rT   	<genexpr>GPydanticModelTransformer.adjust_decorator_signatures.<locals>.<genexpr>  sL       *C &//2f<rCQXAYr^a^g^gkr^rr*Cs   AATN)r#  r   namesvaluesrg   rh   r   original_decoratorsr   calleer!   rl   (IMPLICIT_CLASSMETHOD_DECORATOR_FULLNAMESMODEL_VALIDATOR_FULLNAMEany	enumerater   funcis_class)ra   rm   r?  s     @rT   r0  4PydanticModelTransformer.adjust_decorator_signatures  s     99>>''..0C#((I..HH88;	y(33"9#3#3X>>!((115]] "((115MM  *3INN*C    .2CHHMM*# 1rV   c           
        U R                   n[        5       nSnSnUR                  R                  5        H2  u  pVU R	                  XV5      nU(       d  M  SnUR                  U5        M4     SnUR                  R                   GHN  n[        U[        [        45      (       d  M!  [        U[        5      (       Ga9  UR                  S   n	[        U	[        5      (       a  U	R                  S:w  a  Mm  [        UR                  [        5      (       ac  [!        UR                  R"                  UR                  R$                  5       H)  u  pU
c  M
  UR                  U R	                  XSS95        M+     GO8[        UR                  [&        5      (       aa  UR                  R                   HG  u  p[        U[(        5      (       d  M  UR                  U R	                  UR*                  U5      5        MI     O[        U[        5      (       a  UR                  S:w  a  GM  UR                  R                   Hu  n[        U[        5      (       d  M  UR                  S   n	[        U	[        5      (       d  M@  UR                  U R	                  U	R                  UR                  5      5        Mw     U(       a  U R,                  R/                  SU5          OSnGMQ     U(       d  U(       ak  U(       ad  UR0                  (       aS  UR2                  (       dB  UR4                  (       d1  U R6                  R8                  (       a  [;        U R,                  U5        UR<                  R>                  S	S  H  n[@        URB                  ;  a  M  U R,                  RE                  [G        URH                  5      5        URB                  [@           S
   R                  5        H  u  nnURK                  UU5        M     M     U$ )zhCollects the values of the config attributes that are used by the plugin, accounting for parent classes.FTNr   model_config)	lax_extraConfigzYSpecifying config in two places is ambiguous, use either Config attribute or class kwargs   r   )&r#  ModelConfigDatakeywordsitemsget_config_updateupdatedefsbodyrg   r   r   lvaluesr!   r   rvaluer   zipr;  r   r   r&   r<  r%  failhas_alias_generatorr  r  r\   r   error_required_dynamic_aliasesr   mror   r   add_plugin_dependencyr5   rl   
setdefault)ra   r   r   has_config_kwargshas_config_from_namespacer   exprconfig_datastmtlhsarg_namer   key_expr
value_exprsubstmtr   r<  s                    rT   r*  '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0F4K4K&&DD.tyy$?HHLL$D4==0 II++,A$--,PQ#}}\:8DJJLe!!$.  M % rV   c                .   U R                   n0 n0 n[        UR                  R                  SS 5       GH  n[        UR
                  ;  a  M  U R                  R                  [        UR                  5      5        UR
                  [           S   R                  5        H  u  px[        R                  XhU R                  5      n	U	R                  UR                  U R                  5        XU'   UR                  R                  R                  U5      n
U
(       d  M}  U
R                   (       d  M  [#        U
R                   [$        5      (       a  M  U R                  R'                  SU
R                   5        M     UR
                  [           S   R                  5        H  u  px[(        R                  U5      XW'   M     GM     [+        5       n[+        5       nU R-                  UR.                  5       H  nU R1                  XU5      nUc  M  UR2                  S   n[#        U[4        5      (       d   e[#        U[        5      (       aZ  U(       a(  UR6                  S:w  a  [9        U R                  U5        M  UR;                  UR6                  5        XUR6                  '   M  [#        U[(        5      (       d  M  UR;                  UR6                  5        XUR6                  '   M     [=        UR?                  5       5      [=        UR?                  5       5      4$ )zACollects the fields for the model, accounting for parent classes.rQ  r(  z7BaseModel field may only be overridden by another fieldr)  r   r   ) r#  reversedr   r_  r   r   r%  r`  r5   rl   rT  r   r  r	  rB  r   rh   rg   r+   r\  r  set%_get_assignment_statements_from_blockrW  $collect_field_or_class_var_from_stmtrY  r!   r    error_extra_fields_on_root_modeladdlistrC  )ra   rN  r   r   found_fieldsfound_class_varsr   r   r  r3  sym_nodecurrent_field_namescurrent_class_vars_namesrf  maybe_fieldrg  s                   rT   r+  6PydanticModelTransformer.collect_fields_and_class_varsM  sS    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c8,,,,+'9:: SXX%74TYYE'++CHH5-8*K)>??(,,SXX6-8* I" L'')*D1A1H1H1J,KKKrV   c              #  ,  #    UR                    H/  nUR                  (       a  M  U R                  U5       S h  vN   M1     UR                  b@  UR                  R                  (       d$  U R                  UR                  5       S h  vN   g g g  NV N	7frZ   )rX  is_unreachablerq  	else_body)ra   rf  rX  s      rT   ,_get_assignment_statements_from_if_statementEPydanticModelTransformer._get_assignment_statements_from_if_statement  su     IID&&&EEdKKK  >>%dnn.K.KAA$..QQQ /L% LQs'   BBBABB	BBc              #     #    UR                    HN  n[        U[        5      (       a  Uv   M  [        U[        5      (       d  M5  U R	                  U5       S h  vN   MP     g  N	7frZ   )rX  rg   r   r   r  )ra   blockrf  s      rT   rq  >PydanticModelTransformer._get_assignment_statements_from_block  sL     JJD$//
D&))LLTRRR	  Ss   >A$A$A"
A$c                	   U R                   nUR                  S   n[        U[        5      (       a5  [        R
                  " UR                  5      (       a  UR                  S:X  a  gUR                  (       d  [        UR                  [        5      (       a  [        UR                  R                  [        5      (       af  [        UR                  R                  R                  [        5      (       a3  UR                  R                  R                  R                  [        ;   a  gUR                  U;   a  g[        U R                  U5        gUR                  S   n[        U[        5      (       d  g[        R
                  " UR                  5      (       a  UR                  S:X  a  gUR                  R                   R#                  UR                  5      nUc  gUR$                  n[        U[&        5      (       a  g[        U[(        5      (       a  U R                  R+                  SU5        g[        U[,        5      (       d  gUR.                  (       a  [1        UR                  5      $ [3        UR4                  5      n[        U[6        5      (       a6  UR4                  R                  S:X  a  U R                  R+                  SU5        U R9                  U5      n	U R;                  U5      n
UR4                  c  UR<                  (       a}  UR>                  (       al  U R                  RA                  UR                  SS9nU(       a  Xl        O:U R                  R+                  S	U5        [C        [D        RF                  5      Ul        UR<                  (       a  U	(       a  [1        UR                  5      $ U RI                  U5      u  pU(       aS  URJ                  (       dB  URL                  (       d1  U RN                  RP                  (       a  [S        U R                  U5        U RU                  U5      nU RW                  XeR                  U5      n[Y        UR                  UU	U
UUURZ                  UR\                  UUR                  S
9
$ )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   rN  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#  rY  rg   r!   rF   is_valid_field_namer   
new_syntaxrZ  r   rE  rl   DECORATOR_FULLNAMESerror_untyped_fieldsr%  r   rB  r   rh   r#   r)   r\  r+   is_classvarr  rB   r   r;   get_has_default
get_strictr  is_inferredanalyze_simple_literal_typer9   r>   
from_errorget_alias_infor  r  r\   r   r^  is_field_frozen_infer_dataclass_attr_init_typer   r   r   )ra   rf  rN  r)  r   rg  rm   rh   	node_typer   r   r  r   r   r   	init_types                   rT   rr  =PydanticModelTransformer.collect_field_or_class_var_from_stmt  s?    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$2B2B ))77d7SC			] $I$8$89	==[(22#'#6#6t#< !22l6S6S""@@*499d;((.	88hhM	!/#;;
 	
rV   c                   UR                   nUR                  (       a  U$ [        UR                   5      n[        U[        5      (       d  U$ UR                   R                  S5      nU(       GaP  [        UR                  [        5      (       a  UR                   R                  S5      nU(       d   eUR                   (       a+  [        [        UR                   UR                   U5      5      nO[        [        R                  5      $ [        U[        5      (       a8  UR                  [        [        [        /:X  a  [!        UR"                  S   U5      $ U R$                  R'                  SUR                   R(                   S3U5         U$ U R$                  R'                  SUR                   R(                   S3U5        U$ )zfInfer __init__ argument type for an attribute.

In particular, possibly use the signature of __set__.
__set__rP   z(Unsupported signature for "__set__" in ""zUnsupported "__set__" in ")r   implicitrB   rg   r;   r   rh   r   get_containing_type_infor8   r9   r>   unannotatedr:   	arg_kindsr   r   	arg_typesr%  r\  r   )	ra   rm   r   r   defaulttsetter
super_infosetter_types	            rT   r  8PydanticModelTransformer._infer_dataclass_attr_init_type(  sP   
 ((<<NCHH% !X&&NI&&++w//VV<<YG
!!z;;"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rV   c                &   SU R                   R                  R                  ;   a3  U R                   R                  R                  S   R                  (       d  gU R                  R
                  n[        UR                  5      nUR                  =(       d    UR                  (       + =(       a    UR                  SLn[        UR                  =(       a    UR                  (       + 5      nU R                  UUUUUUUSS9n	U(       Ga  U R                  R                  [        5      R                   n
[#        U
[$        5      (       d   eSU
R                  ;   Ga8  U
R                  S   R                   n[#        U[&        5      (       d   eUGb  UR(                  b  UR(                  n[#        U[*        5      (       d   e[-        UR.                  5       H  u  pUb,  UR1                  S5      (       d  UR1                  S5      (       d  M6  U R                  R3                  UR4                  U   5      nUb.  US:X  a(  UR7                  [9        [:        R<                  5      5      n[?        X5      nU	RA                  [C        UUS[D        5      5        M     U RG                  X5      (       dC  [?        S	5      nU	RA                  [C        U[I        [:        RJ                  5      S[L        5      5        [O        U R                  U R                   SU	[Q        5       S
9  g)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   r4  r   r   ____cli_settings_sourcekwargs)r   return_type))r#  r   rB  plugin_generatedr\   r   r   r   r  r  r   r]  get_field_argumentsr%  rf   r,  rh   rg   r*   r   r   r:   rI  r;  
startswith	anal_typer  acceptChangeExplicitTypeOfAnyr>   from_omitted_genericsr+   appendr   r   should_init_forbid_extrar9   r   r   
add_methodr<   )ra   r(  r   r4  r   r   r   r   r  r   base_settings_nodebase_settings_init_node	func_typearg_idxrh  analyzed_variable_typer   vars                     rT   r-  (PydanticModelTransformer.add_initializerN  s    ---diinn6J6J:6V6g6g""--FMM*00KF4K4KLvQWQiQiqvQv	#'(B(B(b6KbKbGb#c ''%%=#'%) ( 	
 !%!A!ABW!X!]!]0(;;;;/555*<*B*B:*N*S*S'!"97CCCC*6;R;W;W;c 7 < <I%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WrV   c                0   U R                   R                  [         S3U R                   R                  [         S35      /5      n[        U[	        5       /5      n[        [        SU5      US[        5      n[        R                  " U R                   R                  R                  5         U R                  US[        UR                  5      SSUUS9nSSS5        U R                  X5      (       dC  [        S5      n	WR!                  [        U	[#        [$        R&                  5      S[(        5      5        U(       a  WU/-   OU/W-   n[+        U R                   U R,                  S	U[/        U R,                  R0                  5      SS
9  g! , (       d  f       N= f)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.str_fields_setNTF)r   r   r  r   r4  r   r  model_construct)r   r  is_classmethod)r%  
named_typeBUILTINS_NAMErA   r<   r   r+   r   r6   r   rb   r   r  r   r   r  r  r9   r>   r   r   r  r#  rC   r   )
ra   r(  r   r4  r   set_stroptional_set_strfields_set_argumentr   r  s
             rT   r.  3PydanticModelTransformer.add_model_construct_method  sU    ))&&-'=		@T@TXeWffjUk@l?mn$gxz%:;&s=:J'KM]_celm&&tyy'8'8'H'HI++!&--0).'+ , D J ,,V<<h-CKKgi.@.@&A4ST/<t*++CVBWZ^B^IIII%diinn5	
! JIs   *)F
Fc                (   U R                   R                  nU GHZ  nUR                  R                  UR                  5      nUb  UR
                  n[        U[        5      (       a  U=(       d    UR                  Ul	        Mi  [        U[        5      (       a7  U R                  R                  (       d  U R                  R                  5         M   [        U5      nSU SUR"                   S3n	[%        XR                  U R                   5        M  UR'                  XBSS9nXGl        X7l	        UR(                  S-   UR                  -   Ul        [-        [.        U5      UR                  UR                  '   GM]     g! [         a    [!        U5      n Nf = f)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.
Nzsym_node.node: r   r   F)r   .)r#  r   rB  r   r   rh   rg   r+   r   is_propertyr#   r%  final_iterationdeferr   	TypeErrorreprrc   r   r   rl   	_fullnamer'   r   )
ra   r(  r   r  r   r3  rx  r  var_strr   s
             rT   r/  #PydanticModelTransformer.set_frozen  s'   
 yy~~Ezz~~ejj1H#mmc3''&,&?CO_55dii>W>WIIOO%,"%c(  /wiz#--PQRF-fiiKll4l>"( $ 3chh >'6tS'A

388$/  % ,"&s),s   E99FFc                *   XR                   ;  a  gUS:X  aq  [        U[        5      (       a  UR                  S:H  nOC[        U[        5      (       a  UR
                  S:H  nOU(       d  [        XR                  U5        g[        US9$ US:X  a2  Sn[        U[        5      (       a  UR                  S:X  a  Sn[        US	9$ [        U[        5      (       a)  UR                  S
;   a  [        S0 XR                  S:H  0D6$ [        XR                  U5        g)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)
Nr  forbid)forbid_extrar  Tbuiltins.NoneF)r]  )builtins.Truebuiltins.Falser  r   )r!  rg   r&   r<  r    r   error_invalid_config_valuer%  rR  r!   rl   )ra   r   r   rO  r  r]  s         rT   rU  *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rV   c                   U R                   n[        U[        5      (       a  g[        U[        5      (       a  [        UR                  [
        5      (       a  UR                  R                  [        :X  az  [        UR                  UR                  5       HU  u  p#Ub  US:X  a  UR                  [        Ls  $ US:X  d  M*  [        U[        5      =(       a    UR                  S:H  (       + s  $    g[        U[        5      (       + $ )zUReturns a boolean indicating whether the field defined in `stmt` is a required field.Fr  default_factoryr  )rZ  rg   r(   r   rE  r$   rl   FIELD_FULLNAMEr[  r   r;  rc   r   r!   rf  rd  r   r   s       rT   r  (PydanticModelTransformer.get_has_default  s     {{dH%%dH%%*T[['*J*Jt{{OcOcguOu
 !DNN;	<49#4==<<,, *3 9 ]cllo>]^^ < dL111rV   c                   U R                   n[        U[        5      (       a  [        UR                  [        5      (       a  UR                  R
                  [        :X  aj  [        UR                  UR                  5       HF  u  p#US:w  a  M  [        U[        5      (       a$  UR
                  S:X  a    gUR
                  S:X  a    g  g   g)zEReturns a the `strict` value of a field if defined, otherwise `None`.r   r  Tr  FN)rZ  rg   r   rE  r$   rl   r  r[  r   r;  r!   r  s       rT   r  #PydanticModelTransformer.get_strict  s     {{dH%%*T[['*J*Jt{{OcOcguOu DNN;	8#c8,,||6#)99$ < rV   c                   U R                   n[        U[        5      (       a  g[        U[        5      (       a=  [        UR                  [
        5      (       a  UR                  R                  [        :X  d  gSUR                  ;   a)  UR                  UR                  R                  S5         nO:SUR                  ;   a)  UR                  UR                  R                  S5         nOg[        U[        5      (       a  UR                  S4$ g)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.
)NFvalidation_aliasr   F)NT)rZ  rg   r(   r   rE  r$   rl   r  r;  r   indexr&   r<  )rf  rd  r   s      rT   r  'PydanticModelTransformer.get_alias_info  s     {{dH%% tX&&:dkk7+K+KPTP[P[PdPdhvPv /))DNN001CDEC&))DNN009:Cc7##99e##rV   c                   U R                   n[        U[        5      (       a  g[        U[        5      (       a=  [        UR                  [
        5      (       a  UR                  R                  [        :X  d  g[        UR                  5       HB  u  p#US:X  d  M  UR                  U   n[        U[        5      =(       a    UR                  S:H  s  $    g)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  )rZ  rg   r(   r   rE  r$   rl   r  rI  r;  r   r!   )rf  rd  r>  rh  r   s        rT   r  (PydanticModelTransformer.is_field_frozen2  s     {{dH%% tX&&:dkk7+K+KPTP[P[PdPdhvPv $T^^4KA8#iil!#x0TS\\_5TT 5 rV   c	                   U R                   R                  n	U V
s/ s H\  n
U(       a  U
R                  (       a  M  U
R                  U	UUU=(       d    UUU R                  UU=(       a    U
R
                  S:H  S9PM^     nn
U$ s  sn
f )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   )ra   r(  r   r   r   r  r4  r   r   r   r3  	argumentss               rT   r  ,PydanticModelTransformer.get_field_argumentsK  s     yy~~  
  %"9"9	E)7F;#II)A#0#IUZZ65I  	   	 
 
s   BABc                    UR                   (       d<  UR                  (       d+  U R                  U[        UR                  5      5      (       a  gUR
                  (       a  gU R                  R                  $ )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]  r  r\   r   )ra   r(  r   s      rT   r  1PydanticModelTransformer.should_init_forbid_extrak  sT     ''6+B+B,,VT&:T:T5UVV!!333rV   c                z    U  H  nUR                   (       d  M    g   U(       a  U  H  nUR                  b  M    g   g)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]  r3  s      rT   r  1PydanticModelTransformer.is_dynamic_alias_presentx  s>    
 E&&&  ;;&   rV   )r%  r#  r$  r\   N)
r   r   r   zExpression | Statementr   r2   r\   r[   r   r   )r   r   )r   r   )r   rR  )rN  rR  r   r   r   zJtuple[list[PydanticModelField] | None, list[PydanticModelClassVar] | None])rf  r   r   Iterator[AssignmentStmt])r  r   r   r  )rf  r   rN  rR  r)  z dict[str, PydanticModelClassVar]r   z1PydanticModelField | PydanticModelClassVar | None)rm   r'   r   r   r   r   r   r  )
r(  list[PydanticModelField]r   rR  r4  r   r   r   r   r   )r(  r  r   r2   r  r   r   r   r  )r   r   r   r   rO  r   r   ModelConfigData | None)rf  r   r   r   )rf  r   r   r  )rf  r   r   ztuple[str | None, bool])r(  r  r   r   r   r   r   r   r  r   r4  r   r   r   r   r   r   list[Argument])r(  r  r   rR  r   r   )r(  r  r]  r   r   r   )r   r   r   r   r   r!  r   r`   r   r0  r*  r+  r  rq  rr  r  r-  r.  r/  rU  staticmethodr  r  r  r  r  r  r  r   r   rV   rT   r   r     s   	'8 	++ '+ -	+
 ,+ 
+"H26JXBL+BL<@BL	SBLHRSG
"G
2AG
OoG
	:G
R$L4X.4X8G4XVZ4Xko4X	4Xl&
(&
  &
 	&

 &
 
&
PB>!F 2 2*    :  B */(  	
  #'   #' 
@4  rV   r   c                  :   ^  \ rS rSrSrSU 4S jjrSS jrSrU =r$ )r  i  z<A type translator used to change type of Any's, if explicit.c                .   > Xl         [        TU ]	  5         g rZ   )_type_of_anyr_   r`   )ra   type_of_anyrc   s     rT   r`    ChangeExplicitTypeOfAny.__init__  s    'rV   c                t    UR                   [        R                  :X  a  UR                  U R                  S9$ U$ )N)r  )r  r>   r   r   r  )ra   r  s     rT   	visit_any!ChangeExplicitTypeOfAny.visit_any  s0    ==I...??t/@/@?AAHrV   )r  )r  r  r   r   )r  r9   r   r=   )	r   r   r   r   r   r`   r  r   r   r   s   @rT   r  r    s    F rV   r  c                  r    \ rS rSrSr        S	               S
S jjrSS jrSS jrSS jrSr	g)rR  i  z(Pydantic mypy plugin model config class.Nc	                d    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        g rZ   )r  r  r   r  r   r  r]  r   )	ra   r  r  r   r  r   r  r]  r   s	            rT   r`   ModelConfigData.__init__  s2     ). 0!2 0#6 rV   c                v    U R                   R                  5        VVs0 s H  u  pUc  M
  X_M     snn$ s  snnf )zvReturns a dict of Pydantic model config names to their values.

It includes the config if config value is not `None`.
)__dict__rT  )ra   kvs      rT   r1  ModelConfigData.get_values_dict  s3    
 "&!4!4!6H!6!!6HHHs   	55c                r    Uc  gUR                  5       R                  5        H  u  p#[        XU5        M     g)z$Update Pydantic model config values.N)r1  rT  r   )ra   r   r   r  s       rT   rV  ModelConfigData.update  s2    >**,224DADQ 5rV   c                6    [        X5      c  [        XU5        gg)zFSet default value for Pydantic model config if config value is `None`.N)r   r   )ra   r   r<  s      rT   ra  ModelConfigData.setdefault  s    4%Du% &rV   )r  r   r  r]  r  r   r   r  )NNNNNNNN)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   r   r`   r1  rV  ra  r   r   rV   rT   rR  rR    s    2 %)"'+(,)-(,+/"!  %	
 & ' & ) (I &rV   rR  c                ,    U R                  [        5      $ )zXReturn whether the type info is a root model subclass (or the `RootModel` class itself).)ri   ROOT_MODEL_FULLNAME)r   s    rT   r   r     s    ==,--rV   zpydantic-ormzInvalid from_attributes call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                6    UR                  SU  S3U[        S9  g)zCEmits an error when the model does not have `from_attributes=True`.r  z$" does not have from_attributes=TruecodeN)r\  	ERROR_ORM)
model_namer   r   s      rT   r   r     s    HHq@A7QZH[rV   c                6    UR                  SU  S3U[        S9  g)z0Emits an error when the config value is invalid.zInvalid value for "Config.r  r  N)r\  ERROR_CONFIG)r   r   r   s      rT   r  r    s    HH)$q17HNrV   c                .    U R                  SU[        S9  g)zfEmits required dynamic aliases error.

This will be called when `warn_required_dynamic_aliases=True`.
z#Required dynamic aliases disallowedr  N)r\  ERROR_ALIASr   r   s     rT   r^  r^    s    
 HH2G+HNrV   c                N    SnSU  S3nUSU S3-  nUR                  XB[        S9  g)z Emits unexpected behavior error.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        rT   r   r     s?    
 DDLVHTVWL<TFB[\\LHH\)9H:rV   c                .    U R                  SU[        S9  g)z;Emits an error when there is an untyped field in the model.zUntyped fields disallowedr  N)r\  ERROR_UNTYPEDr  s     rT   r  r    s    HH('HFrV   c                .    U R                  SU[        S9  g)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`r  N)r\  ERROR_EXTRA_FIELD_ROOT_MODELr  s     rT   rs  rs    s    HHA7QmHnrV   c                   UR                   nX(R                  ;   an  UR                  U   n	U	R                  (       aN  [        U	R                  [
        5      (       a/  UR                  R                  R                  U	R                  5        [        U [        5      (       a  U R                  S5      n
OU R                  S/ 5      n
U(       a;  U=(       d    [        [        U5      5      n[        [        S5      US[         S5      /nO0U=(       d    [        U5      n[        [        S5      US[         5      /nX-   n/ / / pnU Hv  nUR"                  (       d   S5       eUR%                  UR"                  5        UR%                  UR&                  R(                  5        UR%                  UR*                  5        Mx     [-        XXU
5      nU(       a  U/Ul        [        X#[1        [3        5       /5      5      nUUl         [5        UU5      Ul        UUl        UR:                  S-   U-   Ul        UR>                  Ul        X(R                  ;   a1  [A        X(R                  5      nUR                  U   UR                  U'   U(       au  SUl!        [        UUR6                  5      nUUl         UR<                  Ul        SUl"        [G        U[I        S5      /U5      nUR>                  Ul        [K        [L        U5      n	O[K        [L        U5      n	SU	l        XR                  U'   URN                  R                  R                  R%                  U5        g)	zhVery closely related to `mypy.plugins.common.add_method_to_class`, with a few pydantic-specific changes.zbuiltins.functionr#  NT__pydantic_self__z"All arguments must be fully typed.r  r  )(r   rB  r  rg   rh   r   rW  rX  remover2   r  named_generic_typer?   rC   r   r+   r   r   r  r   r   r   r:   	variablesr   r"   r4   r   rK  rl   r  r   rD   is_decoratedr  r   r!   r'   r   defn)r   r   r   r   r  r   tvar_defr  r   rm   function_typefirstr  r;  r  r   	signaturerJ  r_namer  decs                        rT   r  r    s    88D zzjjJsxx$A$AHHMM  *#677':;../BBG>-*=!>	#f+y$FG4t!4	 #12ItWMN<D&("b)I""H$HH",,-**+"	  Y9=YI'j	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$rV   c                &   U R                  S5      (       d  g[        R                  S:  a  SSKnO SSKn[        U S5       nUR                  U5      sSSS5        $ ! [
         a    SSKnUR                  S5         gf = f! , (       d  f       g= f)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.tomlN)      r   zJNo TOML parser installed, cannot read configuration from `pyproject.toml`.rb)
rw   sysversion_infotomllibtomliImportErrorwarningswarnopenload)r   toml_r3  rfs       rT   r   r   M  s    
 ((
7"	! 
k4	 Bzz"~ 
!	   	MMfg		 
!	 s   A BA?>A?
B)rS   r   r   ztype[Plugin])r|   r/   r   r=   )r   r*   r   r   )r  r   r   r-   r   r   r   r   )r   r   r   r2   r   r   r   r   )r   r2   r   r   r   r   )r   r   r   z8CheckerPluginInterface | SemanticAnalyzerPluginInterfacer   r   r   r   )r   r-   r   r   r   r   )NNF)r   z8SemanticAnalyzerPluginInterface | CheckerPluginInterfacer   r   r   r   r   r  r  r=   r   r  r$  zTypeVarType | Noner  r   r   r   )r   r   r   zdict[str, Any] | None)r   
__future__r   r.  collections.abcr   configparserr   typingr   r   r   mypy.errorcodesr	   mypy.expandtyper
   r   
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+   mypy.optionsr,   mypy.pluginr-   r.   r/   r0   r1   r2   mypy.plugins.commonr3   mypy.semanalr4   mypy.server.triggerr5   
mypy.stater6   mypy.type_visitorr7   mypy.typeopsr8   
mypy.typesr9   r:   r;   r<   r=   r>   r?   r@   rA   rB   mypy.typevarsrC   	mypy.utilrD   mypy.versionrE   mypy_versionpydantic._internalrF   pydantic.versionrG   r   r   rj   r,  r  rq   r  DATACLASS_FULLNAMErG  r  rF  MYPY_VERSION_TUPLEr  rU   rR   r[   rx   r   r  r   r  rR  r   r  r  r  r  r  ERROR_FIELD_DEFAULTSr  r   r  r^  r   r  rs  r  r   r   rV   rT   <module>rR     s   d " 
 $ % & & % @! ! ! ! ! ! ! ! !D !  + 5  , 0   ( 2 4 & / '. = 5 R (5 K   ,?BtAu+u ( (5  3@V 3@l+C +C\#4MT MT`
 
2a aHn (& (&V.
 n&DjQ	*,BJO(*DjQ24I:V *,F
S !13KZX ()9;^`jk \
O
O;;N;Y`;	;G
o "#' U%	AU%	U% U% 	U%
 U% U% !U% U% 
U%prV   