U
    PÈÞfòê  ã                   @  sÌ  d Z ddlmZ ddlZddlmZ ddlmZ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.m/Z/ dd	l0m1Z1 dd
l2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 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lFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQ ddlRmSZS ddlTmUZU ddlVmWZX ddlYmZZZ ddl[m\Z\ zddlFm]Z] W n" e^k
�rö   ddlFmOZ] Y nX dZ_dZ`dZadZbdZcdZddZed Zfd!Zgd"d!d#d$d%d&hZhe\eXƒZieid'k�rBd(nd)Zjd*ZWd+d,d-œd.d/„ZkG d0d1„ d1e7ƒZlG d2d3„ d3ƒZmd4d5d6œd7d8„ZnG d9d:„ d:ƒZoG d;d<„ d<ƒZpG d=d>„ d>ƒZqG d?d@„ d@ƒZredAdBdCƒZsedDdEdCƒZtedFdGdCƒZuedHdIdCƒZvedJdKdCƒZwedJdLdCƒZxedJdMdCƒZyd+dNdOdPdQœdRdS„Zzd+dTdOdPdUœdVdW„Z{dTdOdPdXœdYdZ„Z|d+d[dOdPd\œd]d^„Z}dTdOdPdXœd_d`„Z~dNdOdPdXœdadb„ZdNdOdPdXœdcdd„Z€dsdfdgd+dhd5didjdkdPdlœ	dmdn„Z�d+dodpœdqdr„Z‚dS )tz^This module includes classes and functions designed specifically for use with the mypy plugin.é    )ÚannotationsN)ÚConfigParser)ÚAnyÚCallableÚIterator)Ú	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ÚFunctionContextÚMethodContextÚPluginÚReportConfigContextÚSemanticAnalyzerPluginInterface)Údataclasses)Údeserialize_and_fixup_type)Úset_callable_name)Úmake_wildcard_trigger)Ústate)Úmap_type_from_supertype)ÚAnyTypeÚCallableTypeÚInstanceÚNoneTypeÚ
OverloadedÚTypeÚ	TypeOfAnyÚTypeTypeÚTypeVarTypeÚ	UnionTypeÚget_proper_type)Úfill_typevars)Úget_unique_redefinition_name)Ú__version__)Ú_fields)Úparse_mypy_version)Ú
TypeVarDef)r@   ú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.dataclassz.pydantic.functional_validators.model_validatorz.pydantic.functional_validators.field_validatorz*pydantic.functional_serializers.serializerz0pydantic.functional_serializers.model_serializerz.pydantic.deprecated.class_validators.validatorz3pydantic.deprecated.class_validators.root_validator)r   i¢  ÚbuiltinsÚ__builtins__é   Ústrztype[Plugin])ÚversionÚreturnc                 C  s   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)rN   © rQ   úG/var/www/html/chatgpt/venv/lib/python3.8/site-packages/pydantic/mypy.pyÚplugins   s    rS   c                      s¸   e Zd ZdZdddœ‡ fdd„Zddd	œd
d„Zddd	œdd„Zddd	œdd„Zddd	œdd„Zddd	œdd„Z	dddœdd„Z
dddœdd„Zdddœd d!„Zd"d#dœd$d%„Z‡  ZS )&rP   zThe Pydantic mypy plugin.r*   ÚNone©ÚoptionsrO   c                   s&   t |ƒ| _| j ¡ | _tƒ  |¡ d S ©N)ÚPydanticPluginConfigÚplugin_configÚto_dataÚ_plugin_dataÚsuperÚ__init__)ÚselfrV   ©Ú	__class__rQ   rR   r]   …   s    
zPydanticPlugin.__init__rM   z(Callable[[ClassDefContext], bool] | None)ÚfullnamerO   c                 C  s:   |   |¡}|r6t|jtƒr6tdd„ |jjD ƒƒr6| jS dS )zUpdate Pydantic model class.c                 s  s   | ]}|j tkV  qd S rW   ©ra   ÚBASEMODEL_FULLNAME©Ú.0ÚbaserQ   rQ   rR   Ú	<genexpr>�   s     z5PydanticPlugin.get_base_class_hook.<locals>.<genexpr>N)Úlookup_fully_qualifiedÚ
isinstanceÚnoder(   ÚanyÚmroÚ$_pydantic_model_class_maker_callback©r^   ra   ÚsymrQ   rQ   rR   Úget_base_class_hookŠ   s
    
z"PydanticPlugin.get_base_class_hookz(Callable[[ClassDefContext], None] | Nonec                 C  s   |t kr| jS dS )z,Update Pydantic `ModelMetaclass` definition.N)ÚMODEL_METACLASS_FULLNAMEÚ)_pydantic_model_metaclass_marker_callback©r^   ra   rQ   rQ   rR   Úget_metaclass_hook“   s    z!PydanticPlugin.get_metaclass_hookz(Callable[[FunctionContext], Type] | Nonec                 C  s"   |   |¡}|r|jtkr| jS dS )z/Adjust the return type of the `Field` function.N)rh   ra   ÚFIELD_FULLNAMEÚ_pydantic_field_callbackrn   rQ   rQ   rR   Úget_function_hook™   s    
z PydanticPlugin.get_function_hookz&Callable[[MethodContext], Type] | Nonec                 C  s   |  d¡rtS dS )z-Adjust return type of `from_orm` method call.z	.from_ormN)ÚendswithÚfrom_attributes_callbackrs   rQ   rQ   rR   Úget_method_hook    s    
zPydanticPlugin.get_method_hookc                 C  s   |t krtdk rtjS dS )z€Mark pydantic.dataclasses as dataclass.

        Mypy version 1.1.1 added support for `@dataclass_transform` decorator.
        )é   r{   N)ÚDATACLASS_FULLNAMEÚMYPY_VERSION_TUPLEr2   Zdataclass_class_maker_callbackrs   rQ   rQ   rR   Úget_class_decorator_hook¦   s    z'PydanticPlugin.get_class_decorator_hookr0   údict[str, Any]©ÚctxrO   c                 C  s   | j S )zjReturn all plugin config data.

        Used by mypy to determine if cache needs to be discarded.
        )r[   )r^   r�   rQ   rQ   rR   Úreport_config_data¯   s    z!PydanticPlugin.report_config_datar,   Úboolc                 C  s   t |j|j|j| jƒ}| ¡ S rW   )ÚPydanticModelTransformerÚclsÚreasonÚapirY   Ú	transform)r^   r�   ZtransformerrQ   rQ   rR   rm   ¶   s    z3PydanticPlugin._pydantic_model_class_maker_callbackc                 C  s<   | j jrdS |jjj}|s"tdƒ‚t|jddƒr8d|j_dS )zÓReset 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)	rY   Údebug_dataclass_transformr…   ÚinfoZdeclared_metaclassÚAssertionErrorÚgetattrÚtyper‰   )r^   r�   Zinfo_metaclassrQ   rQ   rR   rr   º   s    
z8PydanticPlugin._pydantic_model_metaclass_marker_callbackr-   r=   c           	        s  |j ‰ |jd dkstdƒ‚|jd dks2tdƒ‚|jd }|jd }|r`|r`t|j|jƒ ˆ S |rŠ|jd d }|d }t|t	ƒsþ|S nt|rþ|jd d }t|t
ƒr°|jd }t|tƒrþ|j}t|ddƒ}|rútd	d
„ |D ƒƒrút‡ fdd
„|D ƒƒ|_|S ˆ S )ao  Extract the type of the `default` argument from the Field function, and use it as the return type.

        In particular:
        * Check whether the default and default_factory argument is specified.
        * Output an error if both are specified.
        * Retrieve the type of the argument which is specified, and use it as return type for the function.
        r   Údefaultz0"default" is no longer first argument in Field()r{   Údefault_factoryz9"default_factory" is no longer second argument in Field()ÚargsNc                 s  s   | ]}t |tƒV  qd S rW   )ri   r@   )re   ÚargrQ   rQ   rR   rg   ð   s     z:PydanticPlugin._pydantic_field_callback.<locals>.<genexpr>c                 3  s   | ]
}ˆ V  qd S rW   rQ   )re   Ú_©Zdefault_any_typerQ   rR   rg   ò   s     )Údefault_return_typeZcallee_arg_namesrŒ   r‘   Ú+error_default_and_default_factory_specifiedr‡   ÚcontextÚ	arg_typesri   r   r<   Úitemsr9   Úret_typer�   ÚallÚtuple)	r^   r�   Zdefault_argsZdefault_factory_argsZdefault_typeZdefault_argZdefault_factory_typerš   r‘   rQ   r”   rR   rv   Ç   s2    





z'PydanticPlugin._pydantic_field_callback)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r]   rp   rt   rw   rz   r~   r‚   rm   rr   rv   Ú__classcell__rQ   rQ   r_   rR   rP   ‚   s   		rP   c                   @  sT   e Zd ZU dZdZded< ded< ded< ded< dd	d
œdd„Zddœdd„ZdS )rX   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Š   rƒ   r¢   r£   r¤   rŠ   r*   rT   rU   c                 C  s°   |j d krd S t|j ƒ}|d k	rr| di ¡ di ¡}| jD ]4}| |d¡}t|tƒsbtd|› �ƒ‚t| ||ƒ q:n:tƒ }| 	|j ¡ | jD ] }|j
t|dd�}t| ||ƒ qŠd S )NZtoolrI   Fz/Configuration value must be a boolean for key: )Úfallback)Úconfig_fileÚ
parse_tomlÚgetÚ	__slots__ri   rƒ   Ú
ValueErrorÚsetattrr   ÚreadÚ
getbooleanÚCONFIGFILE_KEY)r^   rV   Ztoml_configÚconfigÚkeyZsettingrY   rQ   rQ   rR   r]     s    




zPydanticPluginConfig.__init__r   ©rO   c                   s   ‡ fdd„ˆ j D ƒS )z/Returns a dict of config names to their values.c                   s   i | ]}|t ˆ |ƒ“qS rQ   )r�   )re   r°   ©r^   rQ   rR   Ú
<dictcomp>#  s      z0PydanticPluginConfig.to_data.<locals>.<dictcomp>)r©   r²   rQ   r²   rR   rZ   !  s    zPydanticPluginConfig.to_dataN)r�   rž   rŸ   r    r©   Ú__annotations__r]   rZ   rQ   rQ   rQ   rR   rX   ø   s   

rX   r.   r=   r€   c                 C  sÜ   | j }t|tƒr|j}t|tƒr4t|jtƒr4|j}n<t|tƒrD|}n,d|› d|jj› d�}t	|| j
| jƒ | jS |j j t¡}|dkrŒ| jS tdd„ |j jD ƒƒs¨| jS | di ¡ d¡}|d	k	rÖt|j j| j
| jƒ | jS )
z1Raise an error if from_attributes is not enabled.z
ctx.type: ú
 (of type ú)Nc                 s  s   | ]}|j tkV  qd S rW   rb   rd   rQ   rQ   rR   rg   7  s     z+from_attributes_callback.<locals>.<genexpr>r¯   Úfrom_attributesT)rŽ   ri   r?   Úitemr9   rš   r:   r`   r�   Úerror_unexpected_behaviorr‡   r—   r•   Úmetadatar¨   ÚMETADATA_KEYrk   rl   Úerror_from_attributesÚname)r�   Zctx_typeZ
model_typeÚdetailZpydantic_metadatar·   rQ   rQ   rR   ry   &  s&    

ry   c                   @  s´   e Zd ZdZddddddddddd	œ
d
d„Zddddddddddœ	dd„Zd%dddddœdd„Zd&ddddddœdd„Zddœdd„Ze	dddd dœdd„ƒZ
ddd d!œd"d#„Zd$S )'ÚPydanticModelFieldz5Based on mypy.plugins.dataclasses.DataclassAttribute.rM   z
str | Nonerƒ   úbool | NoneÚintúType | Noner(   ©
r½   ÚaliasÚ	is_frozenÚhas_dynamic_aliasÚhas_defaultÚstrictÚlineÚcolumnrŽ   r‹   c                 C  s@   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	d S rW   rÃ   )r^   r½   rÄ   rÅ   rÆ   rÇ   rÈ   rÉ   rÊ   rŽ   r‹   rQ   rQ   rR   r]   C  s    zPydanticModelField.__init__r1   r   )	Úcurrent_infoÚtypedÚmodel_strictÚforce_optionalÚ	use_aliasr‡   Úforce_typevars_invariantÚis_root_model_rootrO   c	                 C  sj   |   ||||¡}	| jdkr|n| j}
|s,|
r:|  ||¡}n
ttjƒ}t|	|d|rTtn|s^| jrbt	nt
d�S )zABased on mypy.plugins.dataclasses.DataclassAttribute.to_argument.N)ÚvariableÚtype_annotationZinitializerÚkind)Úto_varrÈ   r   r8   r>   Úexplicitr   r   rÇ   r   r
   )r^   rË   rÌ   rÍ   rÎ   rÏ   r‡   rÐ   rÑ   rÒ   rÈ   rÓ   rQ   rQ   rR   Úto_argument[  s    
ÿúzPydanticModelField.to_argumentF)rË   r‡   rÐ   rO   c              
   C  s¨   |r&t | jtƒr&| j ¡ }t|_|| _| jdk	r¢t| jddƒdk	r¢t 	|j
j¡�L t|ƒ}|rz|jD ]}t |tƒrdt|_qdt| j| jjj|iƒW  5 Q R £ S Q R X | jS )zABased on mypy.plugins.dataclasses.DataclassAttribute.expand_type.NÚ	self_type)ri   rŽ   r@   Zcopy_modifiedr   Zvariancer�   r‹   r6   Ústrict_optional_setrV   Ústrict_optionalrC   r‘   r   rØ   Úid)r^   rË   r‡   rÐ   Zmodified_typeZfilled_with_typevarsr’   rQ   rQ   rR   r   x  s    


(zPydanticModelField.expand_typer)   )rË   r‡   rÏ   rÐ   rO   c                 C  s0   |r| j dk	r| j }n| j}t||  |||¡ƒS )z<Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.N)rÄ   r½   r)   r   )r^   rË   r‡   rÏ   rÐ   r½   rQ   rQ   rR   rÕ   •  s    zPydanticModelField.to_varr   r±   c              
   C  s8   | j s
t‚| 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É   rÊ   Ú	serializer²   rQ   rQ   rR   rÝ   ¤  s    
÷zPydanticModelField.serialize)r‹   Údatar‡   rO   c                 C  s,   |  ¡ }t| d¡|ƒ}| f ||dœ|—ŽS )úABased on mypy.plugins.dataclasses.DataclassAttribute.deserialize.rŽ   )rŽ   r‹   )Úcopyr3   Úpop)r…   r‹   rÞ   r‡   ÚtyprQ   rQ   rR   Údeserialize³  s    zPydanticModelField.deserializerT   )Úsub_typer‡   rO   c              	   C  s:   | j dk	r6t |jj¡� t| j || jƒ| _ W 5 Q R X dS )zxExpands type vars in the context of a subtype when an attribute is inherited
        from a generic super type.
        N)rŽ   r6   rÙ   rV   rÚ   r7   r‹   )r^   rä   r‡   rQ   rQ   rR   Úexpand_typevar_from_subtypeº  s    
z.PydanticModelField.expand_typevar_from_subtypeN)F)F)r�   rž   rŸ   r    r]   r×   r   rÕ   rÝ   Úclassmethodrã   rå   rQ   rQ   rQ   rR   r¿   @  s     ÿ" ûr¿   c                   @  s:   e Zd ZdZdd„ Zedd dœdd„ƒZddœd	d
„ZdS )ÚPydanticModelClassVarz•Based on mypy.plugins.dataclasses.DataclassAttribute.

    ClassVars are ignored by subclasses.

    Attributes:
        name: the ClassVar name
    c                 C  s
   || _ d S rW   ©r½   )r^   r½   rQ   rQ   rR   r]   Ì  s    zPydanticModelClassVar.__init__r   )rÞ   rO   c                 C  s   |  ¡ }| f |ŽS )rß   )rà   )r…   rÞ   rQ   rQ   rR   rã   Ï  s    z!PydanticModelClassVar.deserializer±   c                 C  s
   d| j iS )rÜ   r½   rè   r²   rQ   rQ   rR   rÝ   Õ  s     ÿzPydanticModelClassVar.serializeN)r�   rž   rŸ   r    r]   ræ   rã   rÝ   rQ   rQ   rQ   rR   rç   Ã  s
   rç   c                   @  s²  e Zd ZU dZddddddhZded	< d
dddddœdd„Zddœdd„Zddœdd„Zddœdd„Z	ddddœdd„Z
dd d!œd"d#„Zd$d d%œd&d'„Zd(dd)d*d+œd,d-„Zd.d/d0d1d2œd3d4„Zd5ddddd6œd7d8„Zd5ddddd6œd9d:„Zd5dddd;œd<d=„ZdYd/d?dd@dAœdBdC„Zed(dd!œdDdE„ƒZed(dFd!œdGdH„ƒZed(dId!œdJdK„ƒZed(dd!œdLdM„ƒZdZd5ddddddddNdOœ	dPdQ„Zd5dddRœdSdT„Zed5dddUœdVdW„ƒZdXS )[r„   z¸Transform 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·   Úpopulate_by_nameÚalias_generatorrÈ   zset[str]Útracked_config_fieldsr   zExpression | Statementr1   rX   rT   )r…   r†   r‡   rY   rO   c                 C  s   || _ || _|| _|| _d S rW   )Ú_clsZ_reasonÚ_apirY   )r^   r…   r†   r‡   rY   rQ   rQ   rR   r]   ì  s    z!PydanticModelTransformer.__init__rƒ   r±   c                 C  sô   | j j}tdd„ |jdd… D ƒƒ}|  ¡ }|  ||¡\}}|dksL|dkrPdS |D ]}|jdkrT dS qTtdd„ |jdd… D ƒƒ}|  ||||¡ |  ||||¡ | j	|| j
|jdkd� |  ¡  d	d
„ |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
        c                 s  s   | ]}t |jkV  qd S rW   )ÚROOT_MODEL_FULLNAMEra   rd   rQ   rQ   rR   rg     s     z5PydanticModelTransformer.transform.<locals>.<genexpr>NéÿÿÿÿFc                 s  s   | ]}|j tkV  qd S rW   )ra   ÚBASESETTINGS_FULLNAMErd   rQ   rQ   rR   rg     s     T)rê   c                 S  s   i | ]}|j | ¡ “qS rQ   ©r½   rÝ   ©re   ÚfieldrQ   rQ   rR   r³     s      z6PydanticModelTransformer.transform.<locals>.<dictcomp>c                 S  s   i | ]}|j | ¡ “qS rQ   ró   )re   Z	class_varrQ   rQ   rR   r³     s      )ÚfieldsÚ
class_varsr¯   )rî   r‹   rk   rl   Úcollect_configÚcollect_fields_and_class_varsrŽ   Úadd_initializerÚadd_model_construct_methodÚ
set_frozenrï   rê   Úadjust_decorator_signaturesÚget_values_dictrº   r»   )r^   r‹   Úis_root_modelr¯   rö   r÷   rõ   Úis_settingsrQ   rQ   rR   rˆ   ù  s&    

ýz"PydanticModelTransformer.transformc                   s„   | j jj ¡ D ]p}t|jtƒr|jjd ‰ tˆ tƒrtˆ j	t
ƒrˆ j	jtkrˆ j	jtkrtt‡ fdd„tˆ jƒD ƒƒsd|jj_q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  s4   | ],\}}ˆ j | d ko*t|tƒo*|jdkV  qdS )ÚmodeÚafterN)Ú	arg_namesri   r$   Úvalue)re   Úir’   ©Z	first_decrQ   rR   rg   /  s   ÿzGPydanticModelTransformer.adjust_decorator_signatures.<locals>.<genexpr>TN)rî   r‹   ÚnamesÚvaluesri   rj   r   Zoriginal_decoratorsr   Úcalleer   ra   ÚDECORATOR_FULLNAMESÚMODEL_VALIDATOR_FULLNAMErk   Ú	enumerater‘   ÚfuncÚis_class)r^   ro   rQ   r  rR   rý     s     ÿ
þ
ý
úþùz4PydanticModelTransformer.adjust_decorator_signaturesÚModelConfigDatac              	   C  sL  | j }tƒ }d}d}|j ¡ D ]&\}}|  ||¡}|rd}| |¡ qd}|jjD �]V}t|t	t
fƒshqRt|t	ƒ�r"|jd }	t|	tƒrR|	jdkr”qRt|jtƒrÞt|jj|jjƒD ](\}
}|
dkrÄq²| | j|
|dd�¡ q²nBt|jtƒ�rŒ|jjD ]*\}}t|tƒ�s
qô| |  |j|¡¡ qônjt|t
ƒ�rŒ|jdk�r<qR|jjD ]F}t|t	ƒ�sX�qD|jd }	t|	tƒ�sr�qD| |  |	j|j¡¡ �qD|�r¦| j d|¡  �q¬d}qR|�s¸|�rä|�rä|j�rä|j�sä| jj�rät| j|ƒ |jjd	d… D ]R}t|j k�r�qô| j !t"|j#ƒ¡ |j t d
  ¡ D ]\}}| $||¡ �q,�qô|S )zhCollects the values of the config attributes that are used by the plugin, accounting for parent classes.FTNr   Úmodel_config)Ú	lax_extraZConfigzYSpecifying config in two places is ambiguous, use either Config attribute or class kwargsr{   r¯   )%rî   r  Úkeywordsr™   Úget_config_updateÚupdateÚdefsÚbodyri   r   r   Úlvaluesr   r½   Úrvaluer   Úzipr  r‘   r   r$   r  rï   ÚfailÚhas_alias_generatorrë   rY   r¤   Úerror_required_dynamic_aliasesr‹   rl   r»   rº   Úadd_plugin_dependencyr5   ra   Ú
setdefault)r^   r…   r¯   Zhas_config_kwargsZhas_config_from_namespacer½   ÚexprZconfig_dataÚstmtÚlhsÚarg_namer’   Zkey_exprZ
value_exprZsubstmtr‹   r  rQ   rQ   rR   rø   8  sz    

þÿþýüz'PydanticModelTransformer.collect_configzJtuple[list[PydanticModelField] | None, list[PydanticModelClassVar] | None])r  rÿ   rO   c                 C  s¨  | j }i }i }t|jjdd… ƒD ]Ä}t|jkr2q"| j t|j	ƒ¡ |jt d  
¡ D ]d\}}t ||| j¡}	|	 |j| j¡ |	||< |jj |¡}
|
rV|
jrVt|
jtƒsV| j d|
j¡ qV|jt d  
¡ D ]\}}t |¡||< qÎq"tƒ }tƒ }|  |j¡D ]Ž}|  |||¡}t|tƒ�r`|jd }|�rH|jdk�rHt| j|ƒ n| |j¡ |||j< n,t|tƒ�r |jd }| |j¡ |||j< �q t| ¡ ƒt| ¡ ƒfS )zACollects the fields for the model, accounting for parent classes.r{   rñ   rö   z7BaseModel field may only be overridden by another fieldr÷   r   Úroot)rî   Úreversedr‹   rl   r»   rº   rï   r  r5   ra   r™   r¿   rã   rå   r  r¨   rj   ri   r)   r  rç   ÚsetÚ%_get_assignment_statements_from_blockr  Ú$collect_field_or_class_var_from_stmtr  r½   Ú error_extra_fields_on_root_modelÚaddÚlistr  )r^   r  rÿ   r…   Zfound_fieldsZfound_class_varsr‹   r½   rÞ   rõ   Úsym_nodeZcurrent_field_namesZcurrent_class_vars_namesr   Zmaybe_fieldr!  rQ   rQ   rR   rù   „  sD    
þ

z6PydanticModelTransformer.collect_fields_and_class_varsr   zIterator[AssignmentStmt])r   rO   c                 c  sJ   |j D ]}|js|  |¡E d H  q|jd k	rF|jjsF|  |j¡E d H  d S rW   )r  Zis_unreachabler&  Z	else_body)r^   r   r  rQ   rQ   rR   Ú,_get_assignment_statements_from_if_statementÅ  s
    
zEPydanticModelTransformer._get_assignment_statements_from_if_statementr   )ÚblockrO   c                 c  s<   |j D ]0}t|tƒr|V  qt|tƒr|  |¡E d H  qd S rW   )r  ri   r   r   r,  )r^   r-  r   rQ   rQ   rR   r&  Ì  s
    


z>PydanticModelTransformer._get_assignment_statements_from_blockr   z dict[str, PydanticModelClassVar]z1PydanticModelField | PydanticModelClassVar | None)r   r  r÷   rO   c                 C  sD  | j }|jd }t|tƒr0t |j¡r0|jdkr4dS |js–t|jt	ƒrxt|jj
t	ƒrxt|jj
j
tƒrx|jj
j
jtkrxdS |j|kr†dS t| j|ƒ dS |jd }t|tƒs®dS t |j¡rÄ|jdkrÈdS |jj |j¡}|dkrädS |j}t|tƒrødS t|tƒ�r| j d|¡ dS t|tƒ�s&dS |j�r8t|jƒS t|jƒ}t|tƒ�rj|jjdk�rj| j d|¡ |  |¡}	|  |¡}
|jdk�rÔ|j�rÔ|j�rÔ| jj |jdd�}|�rº||_n| j d	|¡ t!t"j#ƒ|_|  $|¡\}}|�r|j%�s| j&j'�rt(| j|ƒ |  )|¡}|  *||j|¡}t+|j||	|
|||j,|j-||jd
�
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î   r  ri   r   rF   Zis_valid_field_namer½   Z
new_syntaxr  r   r	  ra   r
  Úerror_untyped_fieldsrï   r‹   r  r¨   rj   r!   r'   r  r)   Zis_classvarrç   rB   rŽ   r:   Úget_has_defaultÚ
get_strictr.  Zis_inferredZanalyze_simple_literal_typer8   r>   Z
from_errorÚget_alias_inforë   rY   r¤   r  Úis_field_frozenÚ_infer_dataclass_attr_init_typer¿   rÉ   rÊ   )r^   r   r  r÷   r…   r!  ro   rj   Z	node_typerÇ   rÈ   râ   rÄ   rÆ   rÅ   Z	init_typerQ   rQ   rR   r'  Ó  s’    
 
ÿþýü	



þ

þ

þ
öz=PydanticModelTransformer.collect_field_or_class_var_from_stmtr%   rM   r   rÂ   )ro   r½   r—   rO   c           	      C  sâ   |j }|jr|S t|j ƒ}t|tƒs(|S |j  d¡}|rÞt|jtƒrÄ|j  d¡}|sXt	‚|j rttt
|j |j |ƒƒ}n
ttjƒS t|tƒr¨|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__rL   z(Unsupported signature for "__set__" in "ú"zUnsupported "__set__" in ")rŽ   ZimplicitrB   ri   r:   r¨   rj   r   Zget_containing_type_inforŒ   r7   r8   r>   Zunannotatedr9   Ú	arg_kindsr   r	   r˜   rï   r  r½   )	r^   ro   r½   r—   r�   ÚtÚsetterZ
super_infoZsetter_typerQ   rQ   rR   r4  T  s.    


ýz8PydanticModelTransformer._infer_dataclass_attr_init_typezlist[PydanticModelField])rö   r¯   r   rÿ   rO   c              
   C  s‚  d| j jjkr"| j jjd js"dS | jj}t|jƒ}|jdk	}t|j	oL|j ƒ}| j
|||||||dd�}	|r’tdkr’|	d jtkrˆtnt|	d _|�r6| j t¡j}
d|
jk�r6|
jd j}|dk	�r6|jdk	�r6|j}t|jƒD ]P\}}| d¡sä| d¡�sqä| j |j| ¡}t||ƒ}|	 t||dtƒ¡ qä|  ||¡�sftd	ƒ}|	 t|ttj ƒdt!ƒ¡ t"| j| j d|	t#ƒ d
� dS )z§Adds a fields-aware `__init__` method to the class.

        The added `__init__` will be annotated with types vs. all `Any` depending on the plugin settings.
        r]   NT)rÌ   rÍ   Úrequires_dynamic_aliasesrÏ   r   rÿ   rÐ   )r{   r   r{   r   Ú__r“   Úkwargs)r‘   Úreturn_type)$rî   r‹   r  Úplugin_generatedrY   r£   rƒ   rÈ   rë   r  Úget_field_argumentsr}   rÔ   r
   r   r   rï   rh   rò   rj   rŽ   r  r  Ú
startswithZ	anal_typer˜   r)   Úappendr   Úshould_init_forbid_extrar8   r>   rÖ   r   Ú
add_methodr;   )r^   rö   r¯   r   rÿ   rÌ   rÍ   rÏ   r:  r‘   Zbase_settings_nodeZbase_settings_init_nodeZ	func_typeZarg_idxr"  Zanalyzed_variable_typerÒ   ÚvarrQ   rQ   rR   rú   z  sD    

ø
z(PydanticModelTransformer.add_initializerc           
   
   C  sê   | j  t› d�| j  t› d�¡g¡}t|tƒ gƒ}ttd|ƒ|dtƒ}t 	| j j
j¡�$ | j|dt|jƒdd||d�}W 5 Q R X |  ||¡s®tdƒ}	| t|	ttjƒdtƒ¡ |r¼||g n|g| }t| j | jd	|t| jjƒdd
� dS )zäAdds a fully typed `model_construct` classmethod to the class.

        Similar to the fields-aware __init__ method, but always uses the field names (not aliases),
        and does not treat settings fields as optional.
        z.setz.strZ_fields_setNTF)rÌ   rÍ   r:  rÏ   r   rÿ   r<  Zmodel_construct)r‘   r=  Úis_classmethod)rï   Ú
named_typeÚBUILTINS_NAMErA   r;   r   r)   r   r6   rÙ   rV   rÚ   r?  rƒ   rÈ   rB  rA  r8   r>   rÖ   r   rC  rî   rC   r‹   )
r^   rö   r¯   r   rÿ   Zset_strZoptional_set_strZfields_set_argumentr‘   rD  rQ   rQ   rR   rû   «  s2    $ù	
úz3PydanticModelTransformer.add_model_construct_method)rö   r‡   rê   rO   c           
   	   C  sø   | j j}|D ]æ}|j |j¡}|dk	r²|j}t|tƒrD|p>|j|_	qòt|t
ƒrb| jjsb| j ¡  qòzt|ƒ}W n tk
rŠ   t|ƒ}Y nX d|› d|j› d�}	t|	| j| j ƒ q|j||dd�}||_||_	|jd |j |_tt|ƒ|j|j< qdS )z§Marks all fields as properties so that attempts to set them trigger mypy errors.

        This is the same approach used by the attrs and dataclasses plugins.
        Nzsym_node.node: rµ   r¶   F)rÏ   Ú.)rî   r‹   r  r¨   r½   rj   ri   r)   rÅ   Zis_propertyr!   rï   Zfinal_iterationZdeferrM   Ú	TypeErrorÚreprr`   r¹   rÕ   ra   Ú	_fullnamer%   r   )
r^   rö   r‡   rê   r‹   rõ   r+  rD  Zvar_strr¾   rQ   rQ   rR   rü   Ó  s(    
z#PydanticModelTransformer.set_frozenFr   úModelConfigData | None)r½   r’   r  rO   c                 C  sÊ   || j krdS |dkrbt|tƒr,|jdk}n,t|tƒrB|jdk}n|sTt|| j|ƒ dS t|d�S |dkr�d}t|t	ƒr†|j
dkr†d}t|d	�S t|t	ƒr¸|j
d
kr¸tf ||j
dkiŽS t|| j|ƒ dS )zÐDetermines 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é   Zforbid)Úforbid_extrarì   Túbuiltins.NoneF)r  )úbuiltins.Trueúbuiltins.FalserO  )rí   ri   r$   r  r   r½   Úerror_invalid_config_valuerï   r  r   ra   )r^   r½   r’   r  rM  r  rQ   rQ   rR   r  ò  s(    


	

z*PydanticModelTransformer.get_config_updatec                 C  sž   | j }t|tƒrdS t|tƒr’t|jtƒr’|jjtkr’t|j	|j
ƒD ]H\}}|dks\|dkrj|jtk	  S |dkrDt|tƒo„|jdk   S qDdS t|tƒ S )zUReturns a boolean indicating whether the field defined in `stmt` is a required field.FNr�   r�   rN  )r  ri   r&   r   r	  r"   ra   ru   r  r‘   r  r`   r   r   ©r   r  r’   r½   rQ   rQ   rR   r0    s    
"z(PydanticModelTransformer.get_has_defaultrÀ   c                 C  s|   | j }t|tƒrxt|jtƒrx|jjtkrxt|j|j	ƒD ]@\}}|dkrHq6t|t
ƒrr|jdkrb dS |jdkrr dS  dS dS )zEReturns a the `strict` value of a field if defined, otherwise `None`.rÈ   rO  TrP  FN)r  ri   r   r	  r"   ra   ru   r  r‘   r  r   rR  rQ   rQ   rR   r1  +  s    "


z#PydanticModelTransformer.get_strictztuple[str | None, bool]c                 C  s„   | j }t|tƒrdS t|tƒr6t|jtƒr6|jjtks:dS t|j	ƒD ]:\}}|dkrVqD|j
| }t|tƒrx|jdf  S  dS qDd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.
        )NFrÄ   F)NT)r  ri   r&   r   r	  r"   ra   ru   r  r  r‘   r$   r  ©r   r  r  r"  r’   rQ   rQ   rR   r2  ;  s$    
ÿ
ÿ
ÿ

z'PydanticModelTransformer.get_alias_infoc                 C  s|   | j }t|tƒrdS t|tƒr6t|jtƒr6|jjtks:dS t|j	ƒD ]2\}}|dkrD|j
| }t|tƒop|jdk  S qDd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ê   rO  )r  ri   r&   r   r	  r"   ra   ru   r  r  r‘   r   rS  rQ   rQ   rR   r3  W  s    
ÿ
ÿ
ÿ
z(PydanticModelTransformer.is_field_frozenúlist[Argument])	rö   rÌ   rÍ   rÏ   r:  r   rÿ   rÐ   rO   c	           
   	     s.   ˆj j‰‡ ‡‡‡‡‡‡‡‡f	dd„|D ƒ}	|	S )zÈHelper 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                   s@   g | ]8}ˆr|j s|jˆˆˆˆp"ˆˆˆjˆ ˆo6|jd kd�‘qS )r#  )rÌ   rÍ   rÎ   rÏ   r‡   rÐ   rÑ   )rÆ   r×   rï   r½   rô   ©	rÐ   r‹   rÿ   r   rÍ   r:  r^   rÌ   rÏ   rQ   rR   Ú
<listcomp>€  s    õøz@PydanticModelTransformer.get_field_arguments.<locals>.<listcomp>)rî   r‹   )
r^   rö   rÌ   rÍ   rÏ   r:  r   rÿ   rÐ   Ú	argumentsrQ   rU  rR   r?  p  s
    õz,PydanticModelTransformer.get_field_arguments)rö   r¯   rO   c                 C  s.   |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ë   Úis_dynamic_alias_presentrƒ   r  rM  rY   r¢   )r^   rö   r¯   rQ   rQ   rR   rB  �  s    z1PydanticModelTransformer.should_init_forbid_extra)rö   r  rO   c                 C  s8   | D ]}|j r dS q|r4| D ]}|jdkr dS qdS )z‘Returns 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ö   r  rõ   rQ   rQ   rR   rX  �  s    
z1PydanticModelTransformer.is_dynamic_alias_presentN)F)F)r�   rž   rŸ   r    rí   r´   r]   rˆ   rý   rø   rù   r,  r&  r'  r4  rú   rû   rü   r  Ústaticmethodr0  r1  r2  r3  r?  rB  rX  rQ   rQ   rQ   rR   r„   Ü  sF   
ú	$LA &1(#! ÷  r„   c                   @  sZ   e Zd ZdZddddddddœdd„Zddœd	d
„Zdddœdd„Zddddœdd„ZdS )r  z(Pydantic mypy plugin model config class.NrÀ   ©rM  rê   r·   rë   r  rÈ   c                 C  s(   || _ || _|| _|| _|| _|| _d S rW   rZ  )r^   rM  rê   r·   rë   r  rÈ   rQ   rQ   rR   r]   ¯  s    	zModelConfigData.__init__r   r±   c                 C  s   dd„ | j  ¡ D ƒS )z†Returns a dict of Pydantic model config names to their values.

        It includes the config if config value is not `None`.
        c                 S  s   i | ]\}}|d k	r||“qS rW   rQ   )re   ÚkÚvrQ   rQ   rR   r³   Ä  s       z3ModelConfigData.get_values_dict.<locals>.<dictcomp>)Ú__dict__r™   r²   rQ   rQ   rR   rþ   ¿  s    zModelConfigData.get_values_dictrL  rT   )r¯   rO   c                 C  s2   |dkrdS |  ¡  ¡ D ]\}}t| ||ƒ qdS )z$Update Pydantic model config values.N)rþ   r™   r«   )r^   r¯   r[  r\  rQ   rQ   rR   r  Æ  s    zModelConfigData.updaterM   r   )r°   r  rO   c                 C  s   t | |ƒdkrt| ||ƒ dS )zFSet default value for Pydantic model config if config value is `None`.N)r�   r«   )r^   r°   r  rQ   rQ   rR   r  Í  s    zModelConfigData.setdefault)NNNNNN)r�   rž   rŸ   r    r]   rþ   r  r  rQ   rQ   rQ   rR   r  ¬  s         ùr  zpydantic-ormzInvalid from_attributes callZPydanticzpydantic-configzInvalid config valuezpydantic-aliaszDynamic alias disallowedzpydantic-unexpectedzUnexpected behaviorzpydantic-fieldzUntyped field disallowedzInvalid Field defaultsz!Extra field on RootModel subclassr+   r   rT   )Ú
model_namer‡   r—   rO   c                 C  s   |j d| › d�|td� dS )zCEmits an error when the model does not have `from_attributes=True`.r6  z$" does not have from_attributes=True©ÚcodeN)r  Ú	ERROR_ORM)r^  r‡   r—   rQ   rQ   rR   r¼   Ü  s    r¼   r1   )r½   r‡   r—   rO   c                 C  s   |j d| › d�|td� dS )z0Emits an error when the config value is invalid.zInvalid value for "Config.r6  r_  N)r  ÚERROR_CONFIG)r½   r‡   r—   rQ   rQ   rR   rQ  á  s    rQ  )r‡   r—   rO   c                 C  s   | j d|td� dS )znEmits 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—   rQ   rQ   rR   r  æ  s    r  z8CheckerPluginInterface | SemanticAnalyzerPluginInterface)r¾   r‡   r—   rO   c                 C  s4   d}d| › d�}|d|› d�7 }|j ||td� 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)r  ÚERROR_UNEXPECTED)r¾   r‡   r—   ÚlinkZfull_messagerQ   rQ   rR   r¹   î  s    r¹   c                 C  s   | j d|td� dS )z;Emits an error when there is an untyped field in the model.zUntyped fields disallowedr_  N)r  ÚERROR_UNTYPEDrd  rQ   rQ   rR   r/  ù  s    r/  c                 C  s   | j d|td� 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)r  ÚERROR_EXTRA_FIELD_ROOT_MODELrd  rQ   rQ   rR   r(  þ  s    r(  c                 C  s   | j d|td� dS )zNEmits an error when `Field` has both `default` and `default_factory` together.z>Field default and default_factory cannot be specified togetherr_  N)r  ÚERROR_FIELD_DEFAULTSrd  rQ   rQ   rR   r–     s    r–   Fz8SemanticAnalyzerPluginInterface | CheckerPluginInterfacer   rT  rÂ   zTypeVarDef | Nonerƒ   )	r‡   r…   r½   r‘   r=  rØ   Útvar_defrE  rO   c                 C  s
  |j }||jkr<|j| }	|	jr<t|	jtƒr<|jj |	j¡ t| t	ƒrR|  
d¡}
n|  dg ¡}
|rŠ|pptt|ƒƒ}ttdƒ|dtdƒg}n |p”t|ƒ}ttdƒ|dtƒg}|| }g g g   }}}|D ]8}|jsØtdƒ‚| |j¡ | |jj¡ | |j¡ qÆt|||||
ƒ}|�r|g|_t||ttƒ gƒƒ}||_ t||ƒ|_||_|jd | |_|j |_ ||jk�rŠt!||jƒ}|j| |j|< |�rÜd|_"t||jƒ}||_ |j|_d|_#t$|t%dƒg|ƒ}|j |_ t&t'|ƒ}	n
t&t'|ƒ}	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î   NTZ__pydantic_self__z"All arguments must be fully typed.rH  ræ   ))r‹   r  r>  ri   rj   r   r  r  Úremover1   rF  Znamed_generic_typer?   rC   r   r)   r   rÓ   rŒ   rA  rÒ   r½   rÔ   r9   Ú	variablesr   r    r4   rŽ   r  ra   rK  rÉ   rD   Zis_decoratedrE  r   r   r%   r   Zdefn)r‡   r…   r½   r‘   r=  rØ   rk  rE  r‹   ro   Zfunction_typeÚfirstr˜   r  r7  r’   Ú	signaturer  Zr_namer\  ÚdecrQ   rQ   rR   rC    sZ    




rC  zdict[str, Any] | None)r¦   rO   c              
   C  s„   |   d¡sdS tjdkr"ddl}n6zddl}W n( tk
rV   ddl}| d¡ Y dS X t| dƒ�}| 	|¡W  5 Q R £ S Q R X dS )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)
rx   ÚsysÚversion_infoZtomllibÚtomliÚImportErrorÚwarningsÚwarnÚopenÚload)r¦   Ztoml_rx  ÚrfrQ   rQ   rR   r§   `  s    



r§   )NNF)ƒr    Ú
__future__r   rt  Úconfigparserr   Útypingr   r   r   Zmypy.errorcodesr   Zmypy.expandtyper   r	   Z
mypy.nodesr
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   Zmypy.optionsr*   Zmypy.pluginr+   r,   r-   r.   r/   r0   r1   Zmypy.pluginsr2   Zmypy.plugins.commonr3   Zmypy.semanalr4   Zmypy.server.triggerr5   Z
mypy.stater6   Zmypy.typeopsr7   Z
mypy.typesr8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   Zmypy.typevarsrC   Z	mypy.utilrD   Zmypy.versionrE   Zmypy_versionZpydantic._internalrF   Zpydantic.versionrG   rH   rw  r®   r»   rc   rò   rð   rq   ru   r|   r  r
  r}   rG  rS   rP   rX   ry   r¿   rç   r„   r  ra  rb  rc  rf  rh  rj  ri  r¼   rQ  r  r¹   r/  r(  r–   rC  r§   rQ   rQ   rQ   rR   Ú<module>   sš   ˆ"$	4ú
v.      U'   ø X