
    bMh                       d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ ddlmZmZ dd	lmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 dd
l1m2Z2 ddl3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA ddlBmCZC ddlDmEZE ddlFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZP ddlQmRZR ddlSmTZT ddlUmVZW ddlXmYZY ddlZm[Z[ dZ\dZ]dZ^dZ_dZ`dZadZbdZcd Zdh d!Zeeed"hz
  Zf e[eW          Zgd#Zhd$ZVdmd)Zi G d* d+e7          Zj G d, d-          Zkdnd1Zl G d2 d3          Zm G d4 d5          Zn G d6 d7          Zo G d8 d9eC          Zp G d: d;          Zqdod?Zr ed@dAdB          Zs edCdDdB          Zt edEdFdB          Zu edGdHdB          Zv edIdJdB          Zw edIdKdB          Zx edIdLdB          ZydpdSZzdqdVZ{drdWZ|dsdZZ}drd[Z~dtd\Z	 	 	 dudvdiZdwdlZdS )xz^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_validator3pydantic.deprecated.class_validators.root_validatorrH   0pydantic.functional_serializers.model_serializerrM   builtins   versionstrreturntype[Plugin]c                    t           S )a!  `version` is the mypy version string.

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

    Args:
        version: The mypy version string.

    Return:
        The Pydantic mypy plugin type.
    )PydanticPlugin)rP   s    M/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pydantic/mypy.pypluginrW   m   s
         c                  T     e Zd ZdZd fdZdd
ZddZddZddZddZ	ddZ
 xZS )rU   zThe Pydantic mypy plugin.optionsr+   rR   Nonec                    t          |          | _        | j                                        | _        t	                                          |           d S N)PydanticPluginConfigplugin_configto_data_plugin_datasuper__init__)selfrZ   	__class__s     rV   rc   zPydanticPlugin.__init__   sH    1':: .6688!!!!!rX   fullnamerQ   (Callable[[ClassDefContext], None] | Nonec                    |                      |          }|r@t          |j        t                    r&|j                            t
                    r| j        S dS )zUpdate Pydantic model class.N)lookup_fully_qualified
isinstancenoder)   has_baseBASEMODEL_FULLNAME$_pydantic_model_class_maker_callback)rd   rf   syms      rV   get_base_class_hookz"PydanticPlugin.get_base_class_hook   sZ    ))(33 	A:ch11 	Ax  !344 A@@trX   c                *    |t           k    r| j        S dS )z,Update Pydantic `ModelMetaclass` definition.N)MODEL_METACLASS_FULLNAME)_pydantic_model_metaclass_marker_callbackrd   rf   s     rV   get_metaclass_hookz!PydanticPlugin.get_metaclass_hook   s    ///AAtrX   &Callable[[MethodContext], Type] | Nonec                >    |                     d          rt          S dS )z-Adjust return type of `from_orm` method call.z	.from_ormN)endswithfrom_attributes_callbackrt   s     rV   get_method_hookzPydanticPlugin.get_method_hook   s#    [)) 	,++trX   ctxr0   dict[str, Any]c                    | j         S )zjReturn all plugin config data.

        Used by mypy to determine if cache needs to be discarded.
        )ra   )rd   r{   s     rV   report_config_dataz!PydanticPlugin.report_config_data   s    
   rX   r-   c                z    t          |j        |j        |j        | j                  }|                                 d S r]   )PydanticModelTransformerclsreasonapir_   	transform)rd   r{   transformers      rV   rn   z3PydanticPlugin._pydantic_model_class_maker_callback   s6    .sw
CGTM_``rX   c                    | j         j        rdS |j        j        j        }|s
J d            t          |j        dd          rd|j        _        dS dS )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   )rd   r{   info_metaclasss      rV   rs   z8PydanticPlugin._pydantic_model_metaclass_marker_callback   sn     7 	F8NNNNNN>&(BDII 	@;?N888	@ 	@rX   rZ   r+   rR   r[   )rf   rQ   rR   rg   )rf   rQ   rR   rv   )r{   r0   rR   r|   )r{   r-   rR   r[   )__name__
__module____qualname____doc__rc   rp   ru   rz   r~   rn   rs   __classcell__re   s   @rV   rU   rU   |   s        ##" " " " " "
         ! ! ! !       @ @ @ @ @ @ @ @rX   rU   c                  P    e Zd ZU dZdZded<   ded<   ded<   ded<   ddZddZdS )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   rZ   r+   rR   r[   c                   |j         d S t          |j                   }||                    di                               di           }| j        D ]P}|                    |d          }t	          |t
                    st          d|           t          | ||           Qd S t                      }|	                    |j                    | j        D ]0}|
                    t          |d          }t          | ||           1d S )NtoolrG   Fz/Configuration value must be a boolean for key: )fallback)config_file
parse_tomlget	__slots__rj   r   
ValueErrorsetattrr   read
getbooleanCONFIGFILE_KEY)rd   rZ   toml_configconfigkeysettingr_   s          rV   rc   zPydanticPluginConfig.__init__   s$   &F !455" __VR0044_bIIF~ , , **S%00!'400 ^$%\WZ%\%\]]]c7++++	, , )NNMw2333~ , ,'22>3QV2WWc7++++, ,rX   r|   c                *      fd j         D             S )z/Returns a dict of config names to their values.c                2    i | ]}|t          |          S  )r   ).0r   rd   s     rV   
<dictcomp>z0PydanticPluginConfig.to_data.<locals>.<dictcomp>   s%    BBBCWT3''BBBrX   )r   rd   s   `rV   r`   zPydanticPluginConfig.to_data   s    BBBB4>BBBBrX   Nr   rR   r|   )r   r   r   r   r   __annotations__rc   r`   r   rX   rV   r^   r^      s          I ''''####, , , ,&C C C C C CrX   r^   r{   r.   r<   c                   | j         }t          |t                    r|j        }t          |t                    r"t          |j        t                    r|j        }nMt          |t                    r|}n5d| d|j        j         d}t          || j
        | j                   | j        S |j         j                            t                    }|| j        S |j                             t"                    s| j        S |                    di                               d          }|dur%t%          |j         j        | j
        | j                   | j        S )z1Raise an error if from_attributes is not enabled.z
ctx.type: 
 (of type )Nr   from_attributesT)r   rj   r>   itemr9   ret_typer:   re   r   error_unexpected_behaviorr   contextdefault_return_typemetadatar   METADATA_KEYrl   rm   error_from_attributesname)r{   ctx_type
model_typedetailpydantic_metadatar   s         rV   ry   ry      sG    xH(H%% !=(L)) 'j9JH.U.U '&

	Hh	'	' '

PhPP(2D2MPPP!&#'3;???&&"044\BB &&?##$677 '&&'++Hb99==>OPPOd""jo2CGS[III""rX   c                  d    e Zd ZdZd-dZd.dZ	 	 d/d0d"Z	 d1d2d$Zd3d&Ze	d4d(            Z
d5d+Zd,S )6PydanticModelFieldz5Based on mypy.plugins.dataclasses.DataclassAttribute.r   rQ   alias
str | None	is_frozenr   has_dynamic_aliashas_defaultstrictbool | Nonelineintcolumnr   Type | Noner   r)   c                    || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        d S r]   )
r   r   r   r   r   r   r   r   r   r   )rd   r   r   r   r   r   r   r   r   r   r   s              rV   rc   zPydanticModelField.__init__   sP     	
"!2&					rX   current_infotypedmodel_strictforce_optional	use_aliasr   r1   force_typevars_invariantis_root_model_rootrR   r   c	                    |                      ||||          }	| j        |n| j        }
|s|
r|                     ||d          }nt          t          j                  }t          |	|d|rt          n|s| j        rt          nt                    S )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   )rd   r   r   r   r   r   r   r   r   r   r   r   s               rV   to_argumentzPydanticModelField.to_argument  s     ;;|S)=UVV!%!4$+ 	:F 	:"..|STX.YYOO%i&899O+!V#1TT5ET--9
 
 
 	
rX   Fr   c                   |rFt          | j        t                    r,| j                                        }t          |_        || _        | j        ,| j        j        t          j	        |j
        j                  5  t          |          }t          |t                    sJ |r+|j        D ]#}t          |t                    rt          |_        $t          | j        | j        j        j        |i          }|rlt          |t                    rWt#          |j                  rC|j        d         j        }	|	|cddd           S t%          |	|          }
t'          ||
g          }|cddd           S # 1 swxY w Y   | j        S )zABased on mypy.plugins.dataclasses.DataclassAttribute.expand_type.Nroot)rj   r   r?   copy_modifiedr   variancer   	self_typer5   strict_optional_setrZ   strict_optionalrB   r:   argsr	   idis_root_modelr
   r@   )rd   r   r   r   r   modified_typefilled_with_typevarsargexpanded_type	root_typeexpanded_root_types              rV   r	   zPydanticModelField.expand_type2  s    $ 	*
 $)[11 * $	 7 7 9 9)2&)	9 TY%8%D
 *3;+FGG % %'4\'B'B$!"6AAAAA+ 538 5 5%c;77 5+4CL +DI	8K8NPd7e f f$ SM8)L)L SQ^_l_qQrQr S !. 26 : ?I (,!% % % % % % % %" *AM)Z)Z&$-}>P.Q$R$RM$'% % % % % % % % % % % % % % % %( ys   <B:E2"E22E69E6r*   c                |    |r| j         | j         }n| j        }t          ||                     |||                    S )z<Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.)r   r   r*   r	   )rd   r   r   r   r   r   s         rV   r   zPydanticModelField.to_var_  sF      	/:DD9D4)),=UVVWWWrX   r   c           
         | j         sJ | j        | j        | j        | j        | j        | j        | j        | j        | j         	                                d	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   	serializer   s    rV   r   zPydanticModelField.serializen  sZ    yIZ!%!7+kIkI''))

 

 
	
rX   datac                    |                                 }t          |                    d          |          } | d||d|S )ABased on mypy.plugins.dataclasses.DataclassAttribute.deserialize.r   )r   r   r   )copyr2   pop)r   r   r   r   typs        rV   deserializezPydanticModelField.deserialize}  sI     yy{{(&)9)93??s/$//$///rX   sub_typer[   c                    | j         Yt          j        |j        j                  5  t          | j         || j                  | _         ddd           dS # 1 swxY w Y   dS dS )zxExpands type vars in the context of a subtype when an attribute is inherited
        from a generic super type.
        N)r   r5   r   rZ   r   r7   r   )rd   r   r   s      rV   expand_typevar_from_subtypez.PydanticModelField.expand_typevar_from_subtype  s     9 *3;+FGG T T3DIxSS	T T T T T T T T T T T T T T T T T T ! s   !AAAN)r   rQ   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   r   r   r   r   rR   r   )FF)
r   r)   r   r1   r   r   r   r   rR   r   F)
r   r)   r   r1   r   r   r   r   rR   r*   rR   r   )r   r)   r   r   r   r1   rR   r   )r   r)   r   r1   rR   r[   )r   r   r   r   rc   r   r	   r   r   classmethodr   r   r   rX   rV   r   r      s        ??   0
 
 
 
B */"'+ + + + +d */X X X X X
 
 
 
 0 0 0 [0T T T T T TrX   r   c                  8    e Zd ZdZd Zed	d            Zd
dZdS )PydanticModelClassVarzBased on mypy.plugins.dataclasses.DataclassAttribute.

    ClassVars are ignored by subclasses.

    Attributes:
        name: the ClassVar name
    c                    || _         d S r]   r   )rd   r   s     rV   rc   zPydanticModelClassVar.__init__  s    			rX   r   r   rR   c                :    |                                 } | di |S )r   r   )r   )r   r   s     rV   r   z!PydanticModelClassVar.deserialize  s#     yy{{s{{T{{rX   c                    d| j         iS )r   r   r  r   s    rV   r   zPydanticModelClassVar.serialize  s     DI
 	
rX   N)r   r   rR   r  r   )r   r   r   r   rc   r  r   r   r   rX   rV   r  r    sa               [

 
 
 
 
 
rX   r  c                     e Zd ZU dZh dZded<   dLdZdMdZdNdZdOdZ	dPdZ
dQdZdRdZdSd$ZdTd,ZdUd1ZdUd2ZdVd4ZdWdXd:ZedYd;            ZedZd=            Zed[d?            ZedYd@            Z	 dWd\dGZd]dHZed^dJ            ZdKS )_r   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_fieldsr   r   r   Expression | Statementr   r1   r_   r^   rR   r[   c                >    || _         || _        || _        || _        d S r]   )_cls_reason_apir_   )rd   r   r   r   r_   s        rV   rc   z!PydanticModelTransformer.__init__  s'     		*rX   r   c                6   | j         j        }t          |          }|                                 }|                     ||          \  }}||dS |D ]}|j         dS |                    t                    }|                     ||||           | 	                    ||||           | 
                    || j        |j        du            |                                  d |D             d |D             |                                d|j        t           <   dS )a  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
        NFT)r
  c                B    i | ]}|j         |                                S r   r   r   )r   fields     rV   r   z6PydanticModelTransformer.transform.<locals>.<dictcomp>  s&    IIIuz5??#4#4IIIrX   c                B    i | ]}|j         |                                S r   r  )r   	class_vars     rV   r   z6PydanticModelTransformer.transform.<locals>.<dictcomp>  s(    ]]]Y9>9+>+>+@+@]]]rX   )fields
class_varsr   )r  r   r   collect_configcollect_fields_and_class_varsr   rl   BASESETTINGS_FULLNAMEadd_initializeradd_model_construct_method
set_frozenr  r
  adjust_decorator_signaturesget_values_dictr   r   )rd   r   is_a_root_modelr   r  r  r  is_settingss           rV   r   z"PydanticModelTransformer.transform  sA    y~'--$$&&!??XX
>Z/5 	 	Ez!uu " mm$9::VV[/JJJ''_UUU	&-42GHHH((*** JI&III]]R\]]],,..'
 '
l# trX   c                   | j         j        j                                        D ]}t	          |j        t                    r|j        j        d         t	          t                    rt	          j	        t                    rfj	        j        t          v rSj	        j        t          k    r-t          fdt          j                  D                       sd|j        j        _        dS )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     K   | ]8\  }}j         |         d k    ot          |t                    o
|j        dk    V  9dS )modeafterN)	arg_namesrj   r%   value)r   ir   	first_decs      rV   	<genexpr>zGPydanticModelTransformer.adjust_decorator_signatures.<locals>.<genexpr>  sg           &3 &/2f<rCQXAYAYr^a^gkr^r           rX   TN)r  r   namesvaluesrj   rk   r   original_decoratorsr   calleer    rf   (IMPLICIT_CLASSMETHOD_DECORATOR_FULLNAMESMODEL_VALIDATOR_FULLNAMEany	enumerater   funcis_class)rd   ro   r.  s     @rV   r#  z4PydanticModelTransformer.adjust_decorator_signatures  s     9>'..00 	2 	2C#(I.. 2H8;	y(332"9#3X>>2 "(15]]] "(15MMM        *3IN*C*C        N .2CHM*#	2 	2rX   ModelConfigDatac           	        | j         }t                      }d}d}|j                                        D ]4\  }}|                     ||          }|rd}|                    |           5d}|j        j        D ]}t          |t          t          f          s t          |t                    r|j        d         }	t          |	t                    r|	j        dk    rdt          |j        t                    rZt!          |j        j        |j        j                  D ]3\  }
}|
|                    |                     |
|d                     4nt          |j        t&                    rV|j        j        D ]I\  }}t          |t(                    s|                    |                     |j        |                     Jnt          |t                    r|j        dk    rk|j        j        D ]n}t          |t                    s|j        d         }	t          |	t                    s;|                    |                     |	j        |j                             o|r| j                            d|            nd}	|s|r8|r6|j        r/|j        s(|j        s!| j        j        rt;          | j        |           |j        j        d	d         D ]}t@          |j!        vr| j        "                    tG          |j$                             |j!        t@                   d
                                         D ]\  }}|%                    ||           |S )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  r:  keywordsitemsget_config_updateupdatedefsbodyrj   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   rf   
setdefault)rd   r   r   has_config_kwargshas_config_from_namespacer   exprconfig_datastmtlhsarg_namer   key_expr
value_exprsubstmtr   r,  s                    rV   r  z'PydanticModelTransformer.collect_config  s   i ""!$)! ,,,.. 	+ 	+JD$00t<<K +$(!k*** "&HM &	- &	-Dd^X$>?? $// Tl1o!#x00 CH4N4Ndk844 	Z),T[-BDKDT)U)U ] ]##+$d&<&<XsVZ&<&[&[\\\\]  X66 Z040A Z Z,*)(G<< %$d&<&<X^Z&X&XYYYYD(++ 	T9((#y~ T TG%g~>> ! !/!,C%c844 ! MM$"8"87>"R"RSSSS  	o   (,%% 	@ 9 	@@.@  0@ 5;4K@ &D	@ /ty$???HL$ 	/ 	/D4=00 I++,A$-,P,PQQQ#}\:8DJJLL / /e!!$..../rX   r<  r   Jtuple[list[PydanticModelField] | None, list[PydanticModelClassVar] | None]c                   | j         }i }i }t          |j        j        dd                   D ]c}t          |j        vr| j                            t          |j	                             |j        t                   d         
                                D ]\  }}t                              ||| j                  }	|	                    |j        | j                   |	||<   |j        j                            |          }
|
rA|
j        r:t#          |
j        t$                    s | j                            d|
j                   |j        t                   d         
                                D ]"\  }}t(                              |          ||<   #et+                      }t+                      }|                     |j                  D ]}|                     |||          }||j        d         }t#          |t4                    sJ t#          |t                    rH|r!|j        dk    rt9          | j        |           x|                    |j                   |||j        <   t#          |t(                    r$|                    |j                   |||j        <   t=          |                                          t=          |                                          fS )	zACollects the fields for the model, accounting for parent classes.r?  r  z7BaseModel field may only be overridden by another fieldr  Nr   r   ) r  reversedr   rL  r   r   r  rM  r4   rf   rA  r   r   r   r0  r   rk   rj   r*   rI  r  set%_get_assignment_statements_from_blockrD  $collect_field_or_class_var_from_stmtrF  r    r    error_extra_fields_on_root_modeladdlistr1  )rd   r<  r   r   found_fieldsfound_class_varsr   r   r   r  sym_nodecurrent_field_namescurrent_class_vars_namesrS  maybe_fieldrT  s                   rV   r  z6PydanticModelTransformer.collect_fields_and_class_varsP  s    i 79=?SX\!B$/00 	Q 	QD 4=00 I++,A$-,P,PQQQ"mL9(CIIKK  
d*66tT49MM
 11#(DIFFF%*T"8>--d33  jPS6T6T INNQ   
 #mL9,GMMOO Q Q
d)>)J)J4)P)P &&Q ),-0UU >>sxHH 	9 	9DCCD,XhiiK",q/Cc8,,,,,+'9:: 9  9SX%7%74TYEEEE'++CH555-8L**K)>?? 9(,,SX666-8 *L''))**D1A1H1H1J1J,K,KKKrX   rS  r   Iterator[AssignmentStmt]c              #     K   |j         D ]$}|j        s|                     |          E d {V  %|j        .|j        j        s$|                     |j                  E d {V  d S d S d S r]   )rE  is_unreachabler^  	else_body)rd   rS  rE  s      rV   ,_get_assignment_statements_from_if_statementzEPydanticModelTransformer._get_assignment_statements_from_if_statement  s      I 	L 	LD& LEEdKKKKKKKKK>%dn.K%AA$.QQQQQQQQQQQ &%%%rX   blockr   c              #     K   |j         D ]L}t          |t                    r|V  t          |t                    r|                     |          E d {V  Md S r]   )rE  rj   r   r   rm  )rd   rn  rS  s      rV   r^  z>PydanticModelTransformer._get_assignment_statements_from_block  s}      J 	S 	SD$// S



D&)) SLLTRRRRRRRRR		S 	SrX   r   r   dict[str, PydanticModelClassVar]1PydanticModelField | PydanticModelClassVar | Nonec                H   | j         }|j        d         }t          |t                    r$t	          j        |j                  r|j        dk    rdS |j        st          |j        t                    rbt          |j        j
        t                    rCt          |j        j
        j
        t                    r|j        j
        j
        j        t          v rdS |j        |v rdS t          | j        |           dS |j        d         }t          |t                    sdS t	          j        |j                  r|j        dk    rdS |j        j                            |j                  }|dS |j        }t          |t&                    rdS t          |t(                    r| j                            d|           dS t          |t,                    sdS |j        rt1          |j                  S t3          |j                  }t          |t6                    r+|j        j        dk    r| j                            d|           |                     |          }	|                     |          }
|j        r|j        rk|j        rd| j                             |j        d          }|r||_        n9| j                            d	|           tC          tD          j#                  |_        |j        r|	rt1          |j                  S | $                    |          \  }}|r/|j%        s(|j&        s!| j'        j(        rtS          | j        |           | *                    |          }| +                    ||j        |          }tY          |j        ||	|
|||j-        |j.        ||j        

  
        S )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   r<  NzFType aliases inside BaseModel definitions are not supported at runtimezdataclasses.InitVarz%InitVar is not supported in BaseModelT)is_finalzGNeed type argument for Final[...] with non-literal default in BaseModel)
r   r   r   r   r   r   r   r   r   r   )/r  rF  rj   r    rE   is_valid_field_namer   
new_syntaxrG  r   r3  rf   DECORATOR_FULLNAMESerror_untyped_fieldsr  r   r0  r   rk   r"   r(   rI  r*   is_classvarr  rA   r   r:   get_has_default
get_strictrs  is_inferredanalyze_simple_literal_typer8   r=   
from_errorget_alias_infor  r  r_   r   rK  is_field_frozen_infer_dataclass_attr_init_typer   r   r   )rd   rS  r<  r  r   rT  ro   rk   	node_typer   r   r   r   r   r   	init_types                   rV   r_  z=PydanticModelTransformer.collect_field_or_class_var_from_stmt  s    il1o#x(( 	0KCH0U0U 	Y\YaesYsYs4 	4;11	t{18<<	 t{18(CC	 K&-6:MMM
 tx:%%t !D1114l1o#x(( 	4*3844 	N8R8R4hn  **; 4xdO,, 	
 4dI&& 	INNX   4$$$ 	
 4  	3(222 $DI..	i** 	y~/FJ_/_/_INN7  
 **400&&8$2B )77d7SSC :			]   $I$899	= 	3[ 	3(222#'#6#6t#<#<  	<!2	<6B6S	< "@	<
 +49d;;;((..	88chMM	!/#;
 
 
 	
rX   ro   r&   r   rQ   r   r   r   c                   |j         }|j        r|S t          |j                   }t          |t                    s|S |j                             d          }|r!t          |j        t                    r|j                             d          }|sJ |j         r)t          t          |j         |j         |                    }nt          t          j                  S t          |t                    r8|j        t          t          t          gk    rt!          |j        d         |          S | j                            d|j         j         d|           n)| j                            d|j         j         d|           |S )zvInfer __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   rj   r:   r   rk   r   get_containing_type_infor7   r8   r=   unannotatedr9   	arg_kindsr   r
   	arg_typesr  rI  r   )	rd   ro   r   r   defaulttsetter
super_infosetter_types	            rV   r  z8PydanticModelTransformer._infer_dataclass_attr_init_type+  sr   
 (< 	NCH%% !X&& 	NI&& 	U&+w// UV<<YGG
!!!!; :"12I&+WXW]_i2j2j"k"kKK"9#8999k<88 g[=RW > >
 3;3H3KQOOOINN#\afk#\#\#\^effff	JAFKJJJGTTTrX   r  list[PydanticModelField]r   r&  c           
     N   d| j         j        j        v r| j         j        j        d         j        sdS | j        j        }t          |j                  }|j        p|j	         o|j
        du}t          |j        o|j                   }|                     |||||||d          }	|ro| j                            t                    j        }
t#          |
t$                    sJ d|
j        v r*|
j        d         j        }t#          |t&                    sJ ||j        |j        }t#          |t*                    sJ t-          |j                  D ]\  }}|*|                    d          s|                    d          s2| j                            |j        |                   }|2|dk    r,|                    t9          t:          j                            }t?          ||          }|	                     tC          ||dtD                               | #                    ||          sPt?          d	          }|	                     tC          |tI          t:          j%                  dtL                               tO          | j        | j         d|	tQ                      
           dS )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.
        rc   NFT)r   r   requires_dynamic_aliasesr   r&  r   r   ____cli_settings_sourcekwargs)r   return_type))r  r   r0  plugin_generatedr_   r   r   r   r  r  r  rJ  get_field_argumentsr  ri   r  rk   rj   r)   r   r   r9   r7  r+  
startswith	anal_typer  acceptChangeExplicitTypeOfAnyr=   from_omitted_genericsr*   appendr   r   should_init_forbid_extrar8   r   r   
add_methodr;   )rd   r  r   r&  r   r   r   r   r  r   base_settings_nodebase_settings_init_node	func_typearg_idxrU  analyzed_variable_typer   vars                     rV   r   z(PydanticModelTransformer.add_initializerQ  s    ---din6J:6V6g-F"-FM**0KF4KLvQWQiqvQv	#'(B(b6KbGb#c#c ''%%=#'%) ( 	
 	
  	_!%!A!ABW!X!X!]0(;;;;;/555*<*B:*N*S'!"97CCCCC*6;R;W;c 7 <I%i>>>>>-6y7J-K-K _ _)#+x/B/B4/H/H+PXPcPcdgPhPh+$151D1DYEXY`Ea1b1b.1=(NdBdBd 6L5R5R 7	8W X X6 62 $'x1G#H#HHX7MtU\$]$]^^^^,,VV<< 	Uh--CKKgi.@&A&A4SSTTT49di$HJJWWWWWWrX   c           
     8   | j                             t           d| j                             t           d          g          }t          |t	                      g          }t          t          d|          |dt                    }t          j	        | j         j
        j                  5  |                     |dt          |j                  dd||          }ddd           n# 1 swxY w Y   |                     ||          sPt          d          }	|                    t          |	t#          t$          j                  dt(                               |r||gz   n|g|z   }t+          | j         | j        d	|t/          | j        j                  d
           dS )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   r&  r   r  model_construct)r   r  is_classmethod)r  
named_typeBUILTINS_NAMEr@   r;   r   r*   r   r5   r   rZ   r   r  r   r   r  r  r8   r=   r   r   r  r  rB   r   )
rd   r  r   r&  r   set_stroptional_set_strfields_set_argumentr   r  s
             rV   r!  z3PydanticModelTransformer.add_model_construct_method  s    )&&-'='='=	@T@TXeUkUkUk@l@l?mnn$gxzz%:;;&s=:J'K'KM]_celmm&ty'8'HII 		 		++!&-00).'+ ,  D		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 ,,VV<< 	Uh--CKKgi.@&A&A4SSTTT/<^t*+++CVBWZ^B^II%din55	
 	
 	
 	
 	
 	
s   */C%%C),C)r
  c                   | j         j        }|D ]C}|j                            |j                  }||j        }t          |t                    r|p|j        |_	        Ot          |t                    r&| j        j        s| j                                         	 t          |          }n# t          $ r t!          |          }Y nw xY wd| d|j         d}	t%          |	| j        | j                    |                    ||d          }||_        ||_	        |j        dz   |j        z   |_        t-          t.          |          |j        |j        <   EdS )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   r0  r   r   rk   rj   r*   r   is_propertyr"   r  final_iterationdeferrQ   	TypeErrorreprre   r   r   rf   	_fullnamer&   r   )
rd   r  r   r
  r   r  re  r  var_strr   s
             rV   r"  z#PydanticModelTransformer.set_frozen  sk   
 y~ 	B 	BEz~~ej11H#mc3'' L&,&?COO_55 Ldi>W LIOO%%%%,"%c(($ , , ,"&s)), SwRR#-RRRF-fdiKKKKll4l>>"( $ 3ch >'6tS'A'A
38$$/	B 	Bs   B**CCFr   r   r=  ModelConfigData | Nonec                
   || j         vrdS |dk    rlt          |t                    r|j        dk    }n;t          |t                    r|j        dk    }n|st          || j        |           dS t          |          S |dk    r4d}t          |t                    r|j
        dk    rd}t          |	          S t          |t                    r |j
        d
v rt          di ||j
        dk    iS t          || j        |           dS )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)rJ  )builtins.Truebuiltins.Falser  r   )r  rj   r%   r,  r   r   error_invalid_config_valuer  r:  r    rf   )rd   r   r   r=  r  rJ  s         rV   rB  z*PydanticModelTransformer.get_config_update  s6   
 t11147??#w'' "yH4C,, "x83  	E /tTYDDDt"====$$$"&#x(( ,S\_-L-L&+#"7JKKKKc8$$ 	N9\)\)\"MMdCLO,K%LMMM"4C888trX   c                   | j         }t          |t                    rdS t          |t                    rt          |j        t
                    rx|j        j        t          k    rct          |j	        |j
                  D ]F\  }}||dk    r|j        t          uc S |dk    r#t          |t                    o
|j        dk     c S GdS t          |t                     S )zUReturns a boolean indicating whether the field defined in `stmt` is a required field.FNr  default_factoryr  )rG  rj   r'   r   r3  r#   rf   FIELD_FULLNAMErH  r   r+  re   r   r    rS  rQ  r   r   s       rV   ry  z(PydanticModelTransformer.get_has_default  s     {dH%% 	5dH%% 	*T['*J*J 	t{OcguOuOu
 !DN;; _ _	T<49#4#4=<<<<,,, *3 9 9 ]clo>]^^^^ -5dL1111rX   r   c                P   | j         }t          |t                    rt          |j        t                    ro|j        j        t          k    rZt          |j        |j	                  D ]?\  }}|dk    rt          |t                    r|j        dk    r dS |j        dk    r dS  dS dS )zEReturns a the `strict` value of a field if defined, otherwise `None`.r   r  Tr  FN)rG  rj   r   r3  r#   rf   r  rH  r   r+  r    r  s       rV   rz  z#PydanticModelTransformer.get_strict  s     {dH%% 		*T['*J*J 		t{OcguOuOu DN;;  	T8##c8,, %|66#tt)999$uutttrX   tuple[str | None, bool]c                   | j         }t          |t                    rdS t          |t                    r/t          |j        t
                    r|j        j        t          k    sdS d|j        v r&|j	        |j        
                    d                   }n1d|j        v r&|j	        |j        
                    d                   }ndS t          |t                    r	|j        dfS dS )a  Returns a pair (alias, has_dynamic_alias), extracted from the declaration of the field defined in `stmt`.

        `has_dynamic_alias` is True if and only if an alias is provided, but not as a string literal.
        If `has_dynamic_alias` is True, `alias` will be None.
        )NFvalidation_aliasr   F)NT)rG  rj   r'   r   r3  r#   rf   r  r+  r   indexr%   r,  )rS  rQ  r   s      rV   r~  z'PydanticModelTransformer.get_alias_info  s     {dH%% 	; tX&&	+5dk7+K+K	PTP[PdhvPvPv ;//)DN001CDDECC&&)DN0099:CC;c7## 	9e##:rX   c                l   | j         }t          |t                    rdS t          |t                    r/t          |j        t
                    r|j        j        t          k    sdS t          |j	                  D ]:\  }}|dk    r/|j
        |         }t          |t                    o
|j        dk    c S ;dS )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  )rG  rj   r'   r   r3  r#   rf   r  r7  r+  r   r    )rS  rQ  r-  rU  r   s        rV   r  z(PydanticModelTransformer.is_field_frozen5  s     {dH%% 	5 tX&&	+5dk7+K+K	PTP[PdhvPvPv 5$T^44 	U 	UKAx8##il!#x00TS\_5TTTT $ urX   r   r   r   r  r   list[Argument]c	           	     \    
  j         j        

 f	d|D             }	|	S )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.
        c                   	 g | ]:}
r|j         |                    	p
j        o
|j        d k              ;S )r   )r   r   r   r   r   r   r   )r   r   r  r   )r   r  r   r   r   r&  r   r  rd   r   r   s     rV   
<listcomp>z@PydanticModelTransformer.get_field_arguments.<locals>.<listcomp>^  s~     
 
 
 
 #("9
)7F;#I)A#0#IUZ65I  	 	
 
 
rX   )r  r   )rd   r  r   r   r   r  r&  r   r   	argumentsr   s   ` ``````` @rV   r  z,PydanticModelTransformer.get_field_argumentsN  sp     y~
 
 
 
 
 
 
 
 
 
 
 
  
 
 
	 rX   c                    |j         s1|j        s*|                     |t          |j                            rdS |j        rdS | j        j        S )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   rJ  r  r_   r   )rd   r  r   s      rV   r  z1PydanticModelTransformer.should_init_forbid_extran  s]     ' 	6+B 	,,VT&:T5U5UVV u 	4!33rX   rJ  c                F    | D ]}|j         r dS |r| D ]}|j         dS dS )zReturns whether any fields on the model have a "dynamic alias", i.e., an alias that cannot be
        determined during static analysis.
        TNF)r   r   )r  rJ  r  s      rV   r  z1PydanticModelTransformer.is_dynamic_alias_present{  sZ    
  	 	E& tt 	     ;&44 'urX   N)
r   r   r   r  r   r1   r_   r^   rR   r[   )rR   r   )rR   r[   )rR   r:  )r<  r:  r   r   rR   rY  )rS  r   rR   ri  )rn  r   rR   ri  )rS  r   r<  r:  r  rp  rR   rq  )ro   r&   r   rQ   r   r   rR   r   )
r  r  r   r:  r&  r   r   r   rR   r[   )r  r  r   r1   r
  r   rR   r[   r   )r   rQ   r   r   r=  r   rR   r  )rS  r   rR   r   )rS  r   rR   r   )rS  r   rR   r  )r  r  r   r   r   r   r   r   r  r   r&  r   r   r   r   r   rR   r  )r  r  r   r:  rR   r   )r  r  rJ  r   rR   r   )r   r   r   r   r  r   rc   r   r#  r  r  rm  r^  r_  r  r   r!  r"  rB  staticmethodry  rz  r~  r  r  r  r  r   rX   rV   r   r     sK         	' 	' 	' 	 	 	 	+ + + +" " " "H2 2 2 26J J J JXBL BL BL BLHR R R RS S S SG
 G
 G
 G
R$ $ $ $L4X 4X 4X 4Xl&
 &
 &
 &
PB B B B>! ! ! ! !F 2 2 2 \2*    \    \:    \B */    @4 4 4 4    \  rX   r   c                  ,     e Zd ZdZd fdZdd
Z xZS )r  z<A type translator used to change type of Any's, if explicit.type_of_anyr   rR   r[   c                V    || _         t                                                       d S r]   )_type_of_anyrb   rc   )rd   r  re   s     rV   rc   z ChangeExplicitTypeOfAny.__init__  s'    'rX   r  r8   r<   c                f    |j         t          j        k    r|                    | j                  S |S )N)r  )r  r=   r   r   r  )rd   r  s     rV   	visit_anyz!ChangeExplicitTypeOfAny.visit_any  s.    =I...??t/@?AAAHrX   )r  r   rR   r[   )r  r8   rR   r<   )r   r   r   r   rc   r  r   r   s   @rV   r  r    sW        FF            rX   r  c                  D    e Zd ZdZ	 	 	 	 	 	 	 	 dddZddZddZddZdS )r:  z(Pydantic mypy plugin model config class.Nr  r   r
  r   r  r  r  rJ  r   c	                v    || _         || _        || _        || _        || _        || _        || _        || _        d S r]   )r  r
  r   r  r  r  rJ  r   )	rd   r  r
  r   r  r  r  rJ  r   s	            rV   rc   zModelConfigData.__init__  sF     ). 0!2 0#6 rX   rR   r|   c                H    d | j                                         D             S )zReturns a dict of Pydantic model config names to their values.

        It includes the config if config value is not `None`.
        c                    i | ]
\  }}|||S r]   r   )r   kvs      rV   r   z3ModelConfigData.get_values_dict.<locals>.<dictcomp>  s    HHHA!-1---rX   )__dict__rA  r   s    rV   r$  zModelConfigData.get_values_dict  s'    
 IH!4!4!6!6HHHHrX   r   r  r[   c                    |dS |                                                                 D ]\  }}t          | ||           dS )z$Update Pydantic model config values.N)r$  rA  r   )rd   r   r  r  s       rV   rC  zModelConfigData.update  sV    >F**,,2244 	  	 DAqD!Q	  	 rX   r   rQ   r,  r   c                L    t          | |          t          | ||           dS dS )zFSet default value for Pydantic model config if config value is `None`.N)r   r   )rd   r   r,  s      rV   rN  zModelConfigData.setdefault  s2    4%D#u%%%%% &%rX   )NNNNNNNN)r  r   r
  r   r   r   r  r   r  r   r  r   rJ  r   r   r   r   )r   r  rR   r[   )r   rQ   r,  r   rR   r[   )r   r   r   r   rc   r$  rC  rN  r   rX   rV   r:  r:    s        22 %)"'+(,)-(,+/"    (I I I I       & & & & & &rX   r:  r   r)   r   c                6    |                      t                    S )zXReturn whether the type info is a root model subclass (or the `RootModel` class itself).)rl   ROOT_MODEL_FULLNAME)r   s    rV   r   r     s    ==,---rX   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 subclass
model_namer   r,   r   r   r[   c                H    |                     d|  d|t                     dS )zCEmits an error when the model does not have `from_attributes=True`.r  z$" does not have from_attributes=TruecodeN)rI  	ERROR_ORM)r  r   r   s      rV   r   r     s-    HHAAAA7QZH[[[[[rX   r   r1   c                H    |                     d|  d|t                     dS )z0Emits an error when the config value is invalid.zInvalid value for "Config.r  r  N)rI  ERROR_CONFIG)r   r   r   s      rV   r  r    s,    HH1$1117HNNNNNrX   c                @    |                      d|t                     dS )znEmits required dynamic aliases error.

    This will be called when `warn_required_dynamic_aliases=True`.
    z#Required dynamic aliases disallowedr  N)rI  ERROR_ALIASr   r   s     rV   rK  rK    s#    
 HH2G+HNNNNNrX   r   8CheckerPluginInterface | SemanticAnalyzerPluginInterfacec                b    d}d|  d}|d| dz  }|                     ||t                     dS )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)rI  ERROR_UNEXPECTED)r   r   r   linkfull_messages        rV   r   r     sO    
 DDWVWWWL\T\\\\LHH\7)9H:::::rX   c                @    |                      d|t                     dS )z;Emits an error when there is an untyped field in the model.zUntyped fields disallowedr  N)rI  ERROR_UNTYPEDr  s     rV   rw  rw    s!    HH('HFFFFFrX   c                @    |                      d|t                     dS )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)rI  ERROR_EXTRA_FIELD_ROOT_MODELr  s     rV   r`  r`    s"    HHA7QmHnnnnnrX   F8SemanticAnalyzerPluginInterface | CheckerPluginInterfacer   r   r   r  r  r   r   tvar_defTypeVarType | Noner  c                ,   |j         }||j        v rR|j        |         }	|	j        r>t          |	j        t
                    r$|j        j                            |	j                   t          | t                    r| 
                    d          }
n|                     dg           }
|rE|pt          t          |                    }t          t          d          |dt           d          g}n6|pt          |          }t          t          d          |dt                     g}||z   }g g g }}}|D ]f}|j        s
J d            |                    |j                   |                    |j        j                   |                    |j                   gt-          |||||
          }|r|g|_        t          ||t1          t3                      g                    }||_         t5          ||          |_        ||_        |j        dz   |z   |_        |j        |_        ||j        v r*tA          ||j                  }|j        |         |j        |<   |rwd|_!        t          ||j                  }||_         |j        |_        d|_"        tG          |tI          d          g|          }|j        |_        tK          tL          |          }	ntK          tL          |          }	d|	_        |	|j        |<   |j'        j        j                            |           dS )	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   r0  r  rj   rk   r   rD  rE  remover1   r  named_generic_typer>   rB   r   r*   r   r   r  r   r   r   r9   	variablesr   r!   r3   r   r9  rf   r  r   rC   is_decoratedr  r   r    r&   r   defn)r   r   r   r   r  r   r  r  r   ro   function_typefirstr  r+  r  r   	signaturer8  r_namer  decs                        rV   r  r    s    8D tzj 	+Jsx$A$A 	+HM  ***#677 H':;;../BBGG O>-*=*=!>!>	#f++y$FFG4t!4!4	 #122ItWMMN4<D&("b)yI # #"HH$HHHH,---*+++""""Y	9k=YYI )'j	4uhjj\2233DDI!)T22DI"DM]S(4/DN	DI tz-dDJ??!Z-
6
  
* di  nx667;;9dC((dD))CDJtINt$$$$$rX   r   dict[str, Any] | Nonec                8   |                      d          sdS t          j        dk    rddl}n0	 ddl}n*# t
          $ r ddl}|                    d           Y dS w xY wt          | d          5 }|	                    |          cddd           S # 1 swxY w Y   dS )zReturns 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)
rx   sysversion_infotomllibtomliImportErrorwarningswarnopenload)r   toml_r  rfs       rV   r   r   P  s   
 (( t
7""	!!!!! 	 	 	OOOMMfggg44		 
k4	 	  Bzz"~~                 s!   3 #AA-BBB)rP   rQ   rR   rS   )r{   r.   rR   r<   )r   r)   rR   r   )r  rQ   r   r,   r   r   rR   r[   )r   rQ   r   r1   r   r   rR   r[   )r   r1   r   r   rR   r[   )r   rQ   r   r  r   r   rR   r[   )r   r,   r   r   rR   r[   )NNF)r   r  r   r   r   rQ   r   r  r  r<   r   r   r  r  r  r   rR   r[   )r   rQ   rR   r
  )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   rm   r  r  rr   r  DATACLASS_FULLNAMEr5  rv  r4  MYPY_VERSION_TUPLEr  rW   rU   r^   ry   r   r  r   r  r:  r   r  r  r  r  r  ERROR_FIELD_DEFAULTSr  r   r  rK  r   rw  r`  r  r   r   rX   rV   <module>r3     s   d d " " " " " " 



 $ $ $ $ $ $ % % % % % %                 % % % % % % @ @ @ @ @ @ @ @! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !D !                               + * * * * * 5 5 5 5 5 5       , , , , , , 0 0 0 0 0 0                        ( ' ' ' ' ' 2 2 2 2 2 2 4 4 4 4 4 4 & & & & & & / / / / / / '. = 5 R (5 K     ,?BtAu+u ( ('55     3@ 3@ 3@ 3@ 3@V 3@ 3@ 3@l+C +C +C +C +C +C +C +C\# # # #4PT PT PT PT PT PT PT PTf
 
 
 
 
 
 
 
2a a a a a a a aH    n   (& (& (& (& (& (& (& (&V. . . .
 In&DjQQ	y*,BJOOi(*DjQQ924I:VV 	*,F
SS y!13KZXX (y)9;^`jkk \ \ \ \
O O O O
O O O O; ; ; ;G G G G
o o o o "#' U% U% U% U% U%p     rX   