
    .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
  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.J/r/J0r0  SS
K1J2r2  SSK3J4r4J5r5J6r6J7r7J8r8J9r9  SSK:J;r;  SSK<J=r=  SSK>J?r?  SSK@JArA  SSKBJCrC  SSKDJErE  SSKFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrP  SSKQJRrR  SSKSJTrT  SSKUJVrW  SSKXJYrY  SSKZJ[r[  Sr\Sr]Sr^Sr_Sr`SraSrbSrcS rd1 S!kre\eS"1-
  rf\[" \W5      rgS#rhS$rVSKS% jri " S& S'\75      rj " S( S)5      rkSLS* jrl " S+ S,5      rm " S- S.5      rn " S/ S05      ro " S1 S2\C5      rp " S3 S45      rqSMS5 jrr\" S6S7S85      rs\" S9S:S85      rt\" S;S<S85      ru\" S=S>S85      rv\" S?S@S85      rw\" S?SAS85      rx\" S?SBS85      rySNSC jrzSOSD 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)	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_validatorrH   0pydantic.functional_serializers.model_serializer3pydantic.deprecated.class_validators.root_validatorrL   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    E/var/www/auris/envauris/lib/python3.13/site-packages/pydantic/mypy.pypluginrT   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$ )rQ   |   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     rS   r_   PydanticPlugin.__init__   s4    1': ..668!rU   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)r`   fullnamesyms      rS   get_base_class_hook"PydanticPlugin.get_base_class_hook   sJ    ))(3:chh11xx  !344@@@rU   c                0    U[         :X  a  U R                  $ g)z,Update Pydantic `ModelMetaclass` definition.N)MODEL_METACLASS_FULLNAME)_pydantic_model_metaclass_marker_callbackr`   rk   s     rS   get_metaclass_hook!PydanticPlugin.get_metaclass_hook   s    //AAArU   c                <    UR                  S5      (       a  [        $ g)z-Adjust return type of `from_orm` method call.z	.from_ormN)endswithfrom_attributes_callbackrr   s     rS   get_method_hookPydanticPlugin.get_method_hook   s    [))++rU   c                    U R                   $ )zZReturn all plugin config data.

Used by mypy to determine if cache needs to be discarded.
)r]   )r`   ctxs     rS   report_config_data!PydanticPlugin.report_config_data   s    
    rU   c                    [        UR                  UR                  UR                  U R                  5      nUR                  5         g rY   )PydanticModelTransformerclsreasonapir[   	transform)r`   r{   transformers      rS   rj   3PydanticPlugin._pydantic_model_class_maker_callback   s0    .sww

CGGTM_M_`rU   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   )r`   r{   info_metaclasss      rS   rq   8PydanticPlugin._pydantic_model_metaclass_marker_callback   sa     7788NNN~>&&(BDII;?N8 JrU   )r]   r[   ra   r+   returnNone)rk   strr   z(Callable[[ClassDefContext], None] | None)rk   r   r   z&Callable[[MethodContext], Type] | None)r{   r0   r   dict[str, Any])r{   r-   r   r   )__name__
__module____qualname____firstlineno____doc__r_   rm   rs   rx   r|   rj   rq   __static_attributes____classcell__rb   s   @rS   rQ   rQ   |   s0    #"
! @ @rU   rQ   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)rZ      a  A Pydantic mypy plugin config holder.

Attributes:
    init_forbid_extra: Whether to add a `**kwargs` at the end of the generated `__init__` signature.
    init_typed: Whether to annotate fields in the generated `__init__`.
    warn_required_dynamic_aliases: Whether to raise required dynamic aliases error.
    debug_dataclass_transform: Whether to not reset `dataclass_transform_spec` attribute
        of `ModelMetaclass` for testing purposes.
)init_forbid_extra
init_typedwarn_required_dynamic_aliasesr   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toolrG   Fz/Configuration value must be a boolean for key: )fallback)config_file
parse_tomlget	__slots__rf   r   
ValueErrorsetattrr   read
getbooleanCONFIGFILE_KEY)r`   ra   toml_configconfigkeysettingr[   s          rS   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+ &rU   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   )r`   r   s     rS   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   rU   rS   rZ   rZ      s3    I #''##,&CrU   rZ   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   rf   r>   itemr9   ret_typer:   rb   r   error_unexpected_behaviorr   contextdefault_return_typemetadatar   METADATA_KEYrh   ri   error_from_attributesname)r{   ctx_type
model_typedetailpydantic_metadatar   s         rS   rw   rw      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"""rU   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 rY   )
r   alias	is_frozenhas_dynamic_aliashas_defaultstrictlinecolumnr   r   )r`   r   r   r   r   r   r   r   r   r   r   s              rS   r_   PydanticModelField.__init__   s8     	
"!2&			rU   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	   r8   r=   explicitr   r   r   r   r   )r`   current_infotypedmodel_strictforce_optional	use_aliasr   force_typevars_invariantis_root_model_rootr   r   r   s               rS   to_argumentPydanticModelField.to_argument  s     ;;|)V!%!4$++F"..|TX.YO%i&8&89O+! 	
 	
 $2T5E5E-
 	
 LU
 	
rU   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                  n	U	c  UsSSS5        $ [%        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)rf   r   r?   copy_modifiedr   variancer   	self_typer5   strict_optional_setra   strict_optionalrB   r:   argsr	   idis_root_modelr
   r@   )r`   r   r   r   r   modified_typefilled_with_typevarsargexpanded_type	root_typeexpanded_root_types              rS   r	   PydanticModelField.expand_type2  sn    $
 $))[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 !. 2 26 : ? ?I (,! HG" *A)Z&$-}.Q$RM$' HG( yy) HG( yys   "AG2BG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	   )r`   r   r   r   r   r   s         rS   r   PydanticModelField.to_var_  s;     /::D99D4)),=UVWWrU   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r`   s    rS   r   PydanticModelField.serializen  sd    yyyIIZZ!%!7!7++kkIIkkII'')

 
	
rU   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   )copyr2   pop)r   r   datar   typs        rS   deserializePydanticModelField.deserialize}  s7     yy{(&)93?//$//rU   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   r5   r   ra   r   r7   r   )r`   sub_typer   s      rS   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   r1   r   r   r   r   r   r   )FF)
r   r)   r   r1   r   r   r   r   r   r  F)
r   r)   r   r1   r   r   r   r   r   r*   r   r   )r   r)   r  r   r   r1   r   r   )r  r)   r   r1   r   r   )r   r   r   r   r   r_   r   r	   r   r   classmethodr  r  r   r   rU   rS   r   r      sg   ?  	
        0

 
 	

 
 
 -
 #'
 !
 

B */"'++ -+ #'	+
  + 
+d */XX -X 	X
 #'X 
X
 0 0TrU   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 rY   r   )r`   r   s     rS   r_   PydanticModelClassVar.__init__  s    	rU   c                2    UR                  5       nU " S0 UD6$ )r   r   )r   )r   r  s     rS   r  !PydanticModelClassVar.deserialize  s     yy{{T{rU   c                    SU R                   0$ )r   r   r  r   s    rS   r   PydanticModelClassVar.serialize  s     DII
 	
rU   r  N)r  r   r   r  r  )
r   r   r   r   r   r_   r  r  r   r   r   rU   rS   r  r    s%      

rU   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 rY   )_cls_reason_apir[   )r`   r   r   r   r[   s        rS   r_   !PydanticModelTransformer.__init__  s     		*rU   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   rh   BASESETTINGS_FULLNAMEadd_initializeradd_model_construct_method
set_frozenr$  r  adjust_decorator_signaturesr   r   get_values_dictr   r   )	r`   r   is_a_root_modelr   r'  r(  fieldis_settings	class_vars	            rS   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_namesrf   r%   value).0ir   	first_decs      rS   	<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valuesrf   rg   r   original_decoratorsr   calleer    rk   (IMPLICIT_CLASSMETHOD_DECORATOR_FULLNAMESMODEL_VALIDATOR_FULLNAMEany	enumerater   funcis_class)r`   rl   r>  s     @rS   r/  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*# 1rU   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bodyrf   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_dependencyr4   rk   
setdefault)r`   r   r   has_config_kwargshas_config_from_namespacer   exprconfig_datastmtlhsarg_namer   key_expr
value_exprsubstmtr   r;  s                    rS   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 % rU   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.rP  r'  z7BaseModel field may only be overridden by another fieldr(  r   r   ) r"  reversedr   r^  r   r   r$  r_  r4   rk   rS  r   r  r  rA  r   rg   rf   r*   r[  r  set%_get_assignment_statements_from_blockrV  $collect_field_or_class_var_from_stmtrX  r    r    error_extra_fields_on_root_modeladdlistrB  )r`   rM  r   r   found_fieldsfound_class_varsr   r   r  r2  sym_nodecurrent_field_namescurrent_class_vars_namesre  maybe_fieldrf  s                   rS   r*  6PydanticModelTransformer.collect_fields_and_class_varsP  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KrU   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rY   )rW  is_unreachablerp  	else_body)r`   re  rW  s      rS   ,_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rY   )rW  rf   r   r   r  )r`   blockre  s      rS   rp  >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   rM  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"  rX  rf   r    rE   is_valid_field_namer   
new_syntaxrY  r   rD  rk   DECORATOR_FULLNAMESerror_untyped_fieldsr$  r   rA  r   rg   r"   r(   r[  r*   is_classvarr  rA   r   r:   get_has_default
get_strictr  is_inferredanalyze_simple_literal_typer8   r=   
from_errorget_alias_infor  r  r[   r   r]  is_field_frozen_infer_dataclass_attr_init_typer   r   r   )r`   re  rM  r(  r   rf  rl   rg   	node_typer   r   r  r   r   r   	init_types                   rS   rq  =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	!/#;;
 	
rU   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__rO   z(Unsupported signature for "__set__" in ""zUnsupported "__set__" in ")r   implicitrA   rf   r:   r   rg   r   get_containing_type_infor7   r8   r=   unannotatedr9   	arg_kindsr   r
   	arg_typesr$  r[  r   )	r`   rl   r   r   defaulttsetter
super_infosetter_types	            rS   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rU   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   r3  r   r   ____cli_settings_sourcekwargs)r   return_type))r"  r   rA  plugin_generatedr[   r   r   r   r  r  r  r\  get_field_argumentsr$  re   r+  rg   rf   r)   r   r   r9   rH  r:  
startswith	anal_typer  acceptChangeExplicitTypeOfAnyr=   from_omitted_genericsr*   appendr   r   should_init_forbid_extrar8   r   r   
add_methodr;   )r`   r'  r   r3  r   r   r   r   r  r   base_settings_nodebase_settings_init_node	func_typearg_idxrg  analyzed_variable_typer   vars                     rS   r,  (PydanticModelTransformer.add_initializerQ  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WrU   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   r3  r   r  model_construct)r   r  is_classmethod)r$  
named_typeBUILTINS_NAMEr@   r;   r   r*   r   r5   r   ra   r   r  r   r   r  r  r8   r=   r   r   r  r"  rB   r   )
r`   r'  r   r3  r   set_stroptional_set_strfields_set_argumentr   r  s
             rS   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   rA  r   r   rg   rf   r*   r   is_propertyr"   r$  final_iterationdeferr   	TypeErrorreprrb   r   r   rk   	_fullnamer&   r   )
r`   r'  r   r  r   r2  rw  r  var_strr   s
             rS   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   rf   r%   r;  r   r   error_invalid_config_valuer$  rQ  r    rk   )r`   r   r   rN  r  r\  s         rS   rT  *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rU   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  )rY  rf   r'   r   rD  r#   rk   FIELD_FULLNAMErZ  r   r:  rb   r   r    re  rc  r   r   s       rS   r  (PydanticModelTransformer.get_has_default  s     {{dH%%dH%%*T[['*J*Jt{{OcOcguOu
 !DNN;	<49#4==<<,, *3 9 ]cllo>]^^ < dL111rU   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)rY  rf   r   rD  r#   rk   r  rZ  r   r:  r    r  s       rS   r  #PydanticModelTransformer.get_strict  s     {{dH%%*T[['*J*Jt{{OcOcguOu DNN;	8#c8,,||6#)99$ < rU   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)rY  rf   r'   r   rD  r#   rk   r  r:  r   indexr%   r;  )re  rc  r   s      rS   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##rU   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  )rY  rf   r'   r   rD  r#   rk   r  rH  r:  r   r    )re  rc  r=  rg  r   s        rS   r  (PydanticModelTransformer.is_field_frozen5  s     {{dH%% tX&&:dkk7+K+KPTP[P[PdPdhvPv $T^^4KA8#iil!#x0TS\\_5TT 5 rU   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   )r`   r'  r   r   r   r  r3  r   r   r   r2  	argumentss               rS   r  ,PydanticModelTransformer.get_field_argumentsN  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   )r`   r'  r   s      rS   r  1PydanticModelTransformer.should_init_forbid_extran  sT     ''6+B+B,,VT&:T:T5UVV!!333rU   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\  r2  s      rS   r  1PydanticModelTransformer.is_dynamic_alias_present{  s>    
 E&&&  ;;&   rU   )r$  r"  r#  r[   N)
r   r   r   zExpression | Statementr   r1   r[   rZ   r   r   )r   r   )r   r   )r   rQ  )rM  rQ  r   r   r   zJtuple[list[PydanticModelField] | None, list[PydanticModelClassVar] | None])re  r   r   Iterator[AssignmentStmt])r  r   r   r  )re  r   rM  rQ  r(  z dict[str, PydanticModelClassVar]r   z1PydanticModelField | PydanticModelClassVar | None)rl   r&   r   r   r   r   r   r  )
r'  list[PydanticModelField]r   rQ  r3  r   r   r   r   r   )r'  r  r   r1   r  r   r   r   r  )r   r   r   r   rN  r   r   ModelConfigData | None)re  r   r   r   )re  r   r   r
  )re  r   r   ztuple[str | None, bool])r'  r  r   r   r   r   r   r   r  r   r3  r   r   r   r   r   r   list[Argument])r'  r  r   rQ  r   r   )r'  r  r\  r   r   r   )r   r   r   r   r   r   r   r_   r   r/  r)  r*  r  rp  rq  r  r,  r-  r.  rT  staticmethodr  r  r  r  r  r  r  r   r   rU   rS   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  rU   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 rY   )_type_of_anyr^   r_   )r`   type_of_anyrb   s     rS   r_    ChangeExplicitTypeOfAny.__init__  s    'rU   c                t    UR                   [        R                  :X  a  UR                  U R                  S9$ U$ )N)r  )r  r=   r   r   r  )r`   r  s     rS   	visit_any!ChangeExplicitTypeOfAny.visit_any  s0    ==I...??t/@/@?AAHrU   )r  )r  r  r   r   )r  r8   r   r<   )	r   r   r   r   r   r_   r  r   r   r   s   @rS   r  r    s    F rU   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)rQ  i  z(Pydantic mypy plugin model config class.Nc	                d    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        g rY   )r  r  r   r  r  r  r\  r   )	r`   r  r  r   r  r  r  r\  r   s	            rS   r_   ModelConfigData.__init__  s2     ). 0!2 0#6 rU   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__rS  )r`   kvs      rS   r0  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)r0  rS  r   )r`   r   r  r   s       rS   rU  ModelConfigData.update  s2    >**,224DADQ 5rU   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   )r`   r   r;  s      rS   r`  ModelConfigData.setdefault  s    4%Du% &rU   )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_   r0  rU  r`  r   r   rU   rS   rQ  rQ    s    2 %)"'+(,)-(,+/"!  %	
 & ' & ) (I &rU   rQ  c                ,    U R                  [        5      $ )zXReturn whether the type info is a root model subclass (or the `RootModel` class itself).)rh   ROOT_MODEL_FULLNAME)r   s    rS   r   r     s    ==,--rU   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      rS   r   r     s    HHq@A7QZH[rU   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      rS   r  r    s    HH)$q17HNrU   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     rS   r]  r]    s    
 HH2G+HNrU   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        rS   r   r     s?    
 DDLVHTVWL<TFB[\\LHH\)9H:rU   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     rS   r  r    s    HH('HFrU   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     rS   rr  rr    s    HHA7QmHnrU   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   rA  r  rf   rg   r   rV  rW  remover1   r  named_generic_typer>   rB   r   r*   r   r   r  r   r   r   r9   	variablesr   r!   r3   r   rJ  rk   r  r   rC   is_decoratedr  r   r    r&   r   defn)r   r   r   r   r  r   tvar_defr  r   rl   function_typefirstr  r:  r  r   	signaturerI  r_namer   decs                        rS   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$rU   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)
rv   sysversion_infotomllibtomliImportErrorwarningswarnopenload)r   toml_r2  rfs       rS   r   r   P  s    
 ((
7"	! 
k4	 Bzz"~ 
!	   	MMfg		 
!	 s   A BA?>A?
B)rR   r   r   ztype[Plugin])r{   r.   r   r<   )r   r)   r   r   )r  r   r   r,   r   r   r   r   )r   r   r   r1   r   r   r   r   )r   r1   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   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.   r/   r0   r1   mypy.plugins.commonr2   mypy.semanalr3   mypy.server.triggerr4   
mypy.stater5   mypy.type_visitorr6   mypy.typeopsr7   
mypy.typesr8   r9   r:   r;   r<   r=   r>   r?   r@   rA   mypy.typevarsrB   	mypy.utilrC   mypy.versionrD   mypy_versionpydantic._internalrE   pydantic.versionrF   r   r   ri   r+  r  rp   r  DATACLASS_FULLNAMErF  r  rE  MYPY_VERSION_TUPLEr  rT   rQ   rZ   rw   r   r  r   r  rQ  r   r  r  r  r  r  ERROR_FIELD_DEFAULTSr  r   r  r]  r   r  rr  r  r   r   rU   rS   <module>rQ     s   d " 
 $ %   % @! ! ! ! ! ! ! ! !D !  + 5  , 0   ( 2 4 & / '. = 5 R (5 K   ,?BtAu+u ( (5  3@V 3@l+C +C\#4PT PTf
 
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rU   