
    xg                       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
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/m0Z0m1Z1 dd
l2m3Z3 ddl4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZD ddlEmFZF ddlGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQ ddlRmSZS ddlTmUZU ddlVmWZX ddlYmZZZ ddl[m\Z\ dZ]dZ^dZ_dZ`dZadZbdZcdZdd Zeh d!Zfefd"hz
  Zg e\eX          Zhd#Zid$ZWdmd)Zj G d* d+e8          Zk G d, d-          Zldnd1Zm G d2 d3          Zn G d4 d5          Zo G d6 d7          Zp G d8 d9eD          Zq G d: d;          Zrdod?Zs ed@dAdB          Zt edCdDdB          Zu edEdFdB          Zv edGdHdB          Zw edIdJdB          Zx edIdKdB          Zy edIdLdB          ZzdpdSZ{dqdV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cast)	ErrorCode)expand_typeexpand_type_by_instance) 	ARG_NAMEDARG_NAMED_OPTARG_OPTARG_POS	ARG_STAR2	INVARIANTMDEFArgumentAssignmentStmtBlockCallExprClassDefContext	DecoratorDictExprEllipsisExpr
ExpressionFuncDefIfStmtJsonDict
MemberExprNameExprPassStmtPlaceholderNodeRefExpr	StatementStrExprSymbolTableNodeTempNode	TypeAliasTypeInfoVar)Options)CheckerPluginInterfaceClassDefContextMethodContextPluginReportConfigContextSemanticAnalyzerPluginInterface)deserialize_and_fixup_type)set_callable_name)make_wildcard_trigger)state)TypeTranslator)map_type_from_supertype)
AnyTypeCallableTypeInstanceNoneTypeType	TypeOfAnyTypeTypeTypeVarType	UnionTypeget_proper_type)fill_typevars)get_unique_redefinition_name)__version__)_fields)parse_mypy_versionpydantic-mypyzpydantic-mypy-metadatazpydantic.main.BaseModelz#pydantic_settings.main.BaseSettingszpydantic.root_model.RootModelz5pydantic._internal._model_construction.ModelMetaclasszpydantic.fields.Fieldzpydantic.dataclasses.dataclass.pydantic.functional_validators.model_validator>   *pydantic.functional_serializers.serializer.pydantic.deprecated.class_validators.validator.pydantic.functional_validators.field_validator3pydantic.deprecated.class_validators.root_validatorrI   0pydantic.functional_serializers.model_serializerrN   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)rQ   s    H/var/www/html/nourish/venv/lib/python3.11/site-packages/pydantic/mypy.pypluginrX   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 )rV   zThe Pydantic mypy plugin.optionsr,   rS   Nonec                    t          |          | _        | j                                        | _        t	                                          |           d S N)PydanticPluginConfigplugin_configto_data_plugin_datasuper__init__)selfr[   	__class__s     rW   rd   zPydanticPlugin.__init__   sH    1':: .6688!!!!!rY   fullnamerR   (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)re   rg   syms      rW   get_base_class_hookz"PydanticPlugin.get_base_class_hook   sZ    ))(33 	A:ch11 	Ax  !344 A@@trY   c                *    |t           k    r| j        S dS )z,Update Pydantic `ModelMetaclass` definition.N)MODEL_METACLASS_FULLNAME)_pydantic_model_metaclass_marker_callbackre   rg   s     rW   get_metaclass_hookz!PydanticPlugin.get_metaclass_hook   s    ///AAtrY   &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_callbackru   s     rW   get_method_hookzPydanticPlugin.get_method_hook   s#    [)) 	,++trY   ctxr1   dict[str, Any]c                    | j         S )zjReturn all plugin config data.

        Used by mypy to determine if cache needs to be discarded.
        )rb   )re   r|   s     rW   report_config_dataz!PydanticPlugin.report_config_data   s    
   rY   r.   c                z    t          |j        |j        |j        | j                  }|                                 d S r^   )PydanticModelTransformerclsreasonapir`   	transform)re   r|   transformers      rW   ro   z3PydanticPlugin._pydantic_model_class_maker_callback   s6    .sw
CGTM_``rY   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   )re   r|   info_metaclasss      rW   rt   z8PydanticPlugin._pydantic_model_metaclass_marker_callback   sm     7 	F8NNNNN~>&(BDII 	@;?N888	@ 	@rY   r[   r,   rS   r\   )rg   rR   rS   rh   )rg   rR   rS   rw   )r|   r1   rS   r}   )r|   r.   rS   r\   )__name__
__module____qualname____doc__rd   rq   rv   r{   r   ro   rt   __classcell__rf   s   @rW   rV   rV   |   s        ##" " " " " "
         ! ! ! !       @ @ @ @ @ @ @ @rY   rV   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   r[   r,   rS   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toolrH   Fz/Configuration value must be a boolean for key: )fallback)config_file
parse_tomlget	__slots__rk   r   
ValueErrorsetattrr   read
getbooleanCONFIGFILE_KEY)re   r[   toml_configconfigkeysettingr`   s          rW   rd   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++++, ,rY   r}   c                *      fd j         D             S )z/Returns a dict of config names to their values.c                2    i | ]}|t          |          S  )r   ).0r   re   s     rW   
<dictcomp>z0PydanticPluginConfig.to_data.<locals>.<dictcomp>   s%    BBBCWT3''BBBrY   )r   re   s   `rW   ra   zPydanticPluginConfig.to_data   s    BBBB4>BBBBrY   Nr   rS   r}   )r   r   r   r   r   __annotations__rd   ra   r   rY   rW   r_   r_      s          I ''''####, , , ,&C C C C C CrY   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   rk   r?   itemr:   ret_typer;   rf   r   error_unexpected_behaviorr   contextdefault_return_typemetadatar   METADATA_KEYrm   rn   error_from_attributesname)r|   ctx_type
model_typedetailpydantic_metadatar   s         rW   rz   rz      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""rY   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   rR   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   )re   r   r   r   r   r   r   r   r   r   r   s              rW   rd   zPydanticModelField.__init__   sP     	
"!2&					rY   current_infotypedmodel_strictforce_optional	use_aliasr   r2   force_typevars_invariantis_root_model_rootrS   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
   r9   r>   explicitr   r   r   r   r   )re   r   r   r   r   r   r   r   r   r   r   r   s               rW   to_argumentzPydanticModelField.to_argument  s     ;;|S)=UVV!%!4$+ 	:F 	:"..|STX.YYOO%i&899O+!V#1TT5ET--9
 
 
 	
rY   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          }|rot          |t                    rZt#          |j                  rFt%          t&          |j        d         j                  }	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)rk   r   r@   copy_modifiedr   variancer   	self_typer6   strict_optional_setr[   strict_optionalrC   r;   argsr
   idis_root_modelr   r=   r   rA   )re   r   r   r   r   modified_typefilled_with_typevarsargexpanded_type	root_typeexpanded_root_types              rW   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 !%T=+=f+E+J K KI)@M)Z)Z&$-}>P.Q$R$RM$!% % % % % % % % % % % % % % % %" ys   <C,E55E9<E9r+   c                |    |r| j         | j         }n| j        }t          ||                     |||                    S )z<Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.)r   r   r+   r
   )re   r   r   r   r   r   s         rW   r   zPydanticModelField.to_var\  sF      	/:DD9D4)),=UVVWWWrY   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    rW   r   zPydanticModelField.serializek  sY    yyIZ!%!7+kIkI''))

 

 
	
rY   datac                    |                                 }t          |                    d          |          } | d||d|S )ABased on mypy.plugins.dataclasses.DataclassAttribute.deserialize.r   )r   r   r   )copyr3   pop)r   r   r   r   typs        rW   deserializezPydanticModelField.deserializez  sI     yy{{(&)9)93??s/$//$///rY   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   r6   r   r[   r   r8   r   )re   r   r   s      rW   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   rR   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   r2   r   r   r   r   rS   r   )FF)
r   r*   r   r2   r   r   r   r   rS   r   F)
r   r*   r   r2   r   r   r   r   rS   r+   rS   r   )r   r*   r   r   r   r2   rS   r   )r   r*   r   r2   rS   r\   )r   r   r   r   rd   r   r
   r   r   classmethodr   r   r   rY   rW   r   r      s        ??   0
 
 
 
B */"'( ( ( ( (^ */X X X X X
 
 
 
 0 0 0 [0T T T T T TrY   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   )re   r   s     rW   rd   zPydanticModelClassVar.__init__  s    			rY   r   r   rS   c                :    |                                 } | di |S )r   r   )r   )r   r   s     rW   r   z!PydanticModelClassVar.deserialize  s#     yy{{s{{T{{rY   c                    d| j         iS )r   r   r  r   s    rW   r   zPydanticModelClassVar.serialize  s     DI
 	
rY   N)r   r   rS   r  r  )r   r   r   r   rd   r  r   r   r   rY   rW   r  r    sa               [

 
 
 
 
 
rY   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   r2   r`   r_   rS   r\   c                >    || _         || _        || _        || _        d S r^   )_cls_reason_apir`   )re   r   r   r   r`   s        rW   rd   z!PydanticModelTransformer.__init__  s'     		*rY   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     rW   r   z6PydanticModelTransformer.transform.<locals>.<dictcomp>  s&    IIIuz5??#4#4IIIrY   c                B    i | ]}|j         |                                S r   r  )r   	class_vars     rW   r   z6PydanticModelTransformer.transform.<locals>.<dictcomp>  s(    ]]]Y9>9+>+>+@+@]]]rY   )fields
class_varsr   )r  r   r   collect_configcollect_fields_and_class_varsr   rm   BASESETTINGS_FULLNAMEadd_initializeradd_model_construct_method
set_frozenr  r  adjust_decorator_signaturesget_values_dictr   r   )re   r   is_a_root_modelr   r  r  r  is_settingss           rW   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# trY   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_namesrk   r&   value)r   ir   	first_decs      rW   	<genexpr>zGPydanticModelTransformer.adjust_decorator_signatures.<locals>.<genexpr>  sg           &3 &/2f<rCQXAYAYr^a^gkr^r           rY   TN)r  r   namesvaluesrk   rl   r   original_decoratorsr   calleer!   rg   (IMPLICIT_CLASSMETHOD_DECORATOR_FULLNAMESMODEL_VALIDATOR_FULLNAMEany	enumerater   funcis_class)re   rp   r/  s     @rW   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 	2rY   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bodyrk   r   r   lvaluesr!   r   rvaluer   zipr,  r   r   r&   r-  r  failhas_alias_generatorr  r  r`   r   error_required_dynamic_aliasesr   mror   r   add_plugin_dependencyr5   rg   
setdefault)re   r   r   has_config_kwargshas_config_from_namespacer   exprconfig_datastmtlhsarg_namer   key_expr
value_exprsubstmtr   r-  s                    rW   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!!$..../rY   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   rM  r   r   r  rN  r5   rg   rB  r   r   r   r1  r   rl   rk   r+   rJ  r  set%_get_assignment_statements_from_blockrE  $collect_field_or_class_var_from_stmtrG  r!   r    error_extra_fields_on_root_modeladdlistr2  )re   r=  r   r   found_fieldsfound_class_varsr   r   r   r  sym_nodecurrent_field_namescurrent_class_vars_namesrT  maybe_fieldrU  s                   rW   r  z6PydanticModelTransformer.collect_fields_and_class_varsM  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KrY   rT  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^   )rF  is_unreachabler_  	else_body)re   rT  rF  s      rW   ,_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 &%%%rY   blockr   c              #     K   |j         D ]L}t          |t                    r|V  t          |t                    r|                     |          E d {V  Md S r^   )rF  rk   r   r   rn  )re   ro  rT  s      rW   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rY   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  rG  rk   r!   rF   is_valid_field_namer   
new_syntaxrH  r   r4  rg   DECORATOR_FULLNAMESerror_untyped_fieldsr  r   r1  r   rl   r#   r)   rJ  r+   is_classvarr  rB   r   r;   get_has_default
get_strictrt  is_inferredanalyze_simple_literal_typer9   r>   
from_errorget_alias_infor  r  r`   r   rL  is_field_frozen_infer_dataclass_attr_init_typer   r   r   )re   rT  r=  r  r   rU  rp   rl   	node_typer   r   r   r   r   r   	init_types                   rW   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	!/#;
 
 
 	
rY   rp   r'   r   rR   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__rP   z(Unsupported signature for "__set__" in ""zUnsupported "__set__" in ")r   implicitrB   rk   r;   r   rl   r   get_containing_type_infor8   r9   r>   unannotatedr:   	arg_kindsr   r   	arg_typesr  rJ  r   )	re   rp   r   r   defaulttsetter
super_infosetter_types	            rW   r  z8PydanticModelTransformer._infer_dataclass_attr_init_type(  sq   
 (< 	NCH%% !X&& 	NI&& 	U&+w// UV<<YGG
!!!z; :"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rY   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.
        rd   NFT)r   r   requires_dynamic_aliasesr   r'  r   r   ____cli_settings_sourcekwargs)r   return_type))r  r   r1  plugin_generatedr`   r   r   r   r  r  r  rK  get_field_argumentsr  rj   r   rl   rk   r*   r   r   r:   r8  r,  
startswith	anal_typer  acceptChangeExplicitTypeOfAnyr>   from_omitted_genericsr+   appendr   r   should_init_forbid_extrar9   r   r   
add_methodr<   )re   r  r   r'  r   r   r   r   r  r   base_settings_nodebase_settings_init_node	func_typearg_idxrV  analyzed_variable_typer   vars                     rW   r!  z(PydanticModelTransformer.add_initializerN  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WrY   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_NAMErA   r<   r   r+   r   r6   r   r[   r   r  r   r   r  r  r9   r>   r   r   r  r  rC   r   )
re   r  r   r'  r   set_stroptional_set_strfields_set_argumentr   r  s
             rW   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   r1  r   r   rl   rk   r+   r   is_propertyr#   r  final_iterationdeferrR   	TypeErrorreprrf   r   r   rg   	_fullnamer'   r   )
re   r  r   r  r   r  rf  r  var_strr   s
             rW   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)rK  )builtins.Truebuiltins.Falser  r   )r  rk   r&   r-  r    r   error_invalid_config_valuer  r;  r!   rg   )re   r   r   r>  r  rK  s         rW   rC  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trY   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  )rH  rk   r(   r   r4  r$   rg   FIELD_FULLNAMErI  r   r,  rf   r   r!   rT  rR  r   r   s       rW   rz  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1rY   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)rH  rk   r   r4  r$   rg   r  rI  r   r,  r!   r  s       rW   r{  z#PydanticModelTransformer.get_strict  s     {dH%% 		*T['*J*J 		t{OcguOuOu DN;;  	T8##c8,, %|66#tt)999$uutttrY   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)rH  rk   r(   r   r4  r$   rg   r  r,  r   indexr&   r-  )rT  rR  r   s      rW   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##:rY   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  )rH  rk   r(   r   r4  r$   rg   r  r8  r,  r   r!   )rT  rR  r.  rV  r   s        rW   r  z(PydanticModelTransformer.is_field_frozen2  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 $ urY   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  re   r   r   s     rW   
<listcomp>z@PydanticModelTransformer.get_field_arguments.<locals>.<listcomp>[  s~     
 
 
 
 #("9
)7F;#I)A#0#IUZ65I  	 	
 
 
rY   )r  r   )re   r  r   r   r   r  r'  r   r   	argumentsr   s   ` ``````` @rW   r  z,PydanticModelTransformer.get_field_argumentsK  sp     y~
 
 
 
 
 
 
 
 
 
 
 
  
 
 
	 rY   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   rK  r  r`   r   )re   r  r   s      rW   r  z1PydanticModelTransformer.should_init_forbid_extrak  s]     ' 	6+B 	,,VT&:T5U5UVV u 	4!33rY   rK  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  rK  r  s      rW   r  z1PydanticModelTransformer.is_dynamic_alias_presentx  sZ    
  	 	E& tt 	     ;&44 'urY   N)
r   r   r   r  r   r2   r`   r_   rS   r\   )rS   r   )rS   r\   )rS   r;  )r=  r;  r   r   rS   rZ  )rT  r   rS   rj  )ro  r   rS   rj  )rT  r   r=  r;  r  rq  rS   rr  )rp   r'   r   rR   r   r   rS   r   )
r  r  r   r;  r'  r   r   r   rS   r\   )r  r  r   r2   r  r   rS   r\   r   )r   rR   r   r   r>  r   rS   r  )rT  r   rS   r   )rT  r   rS   r   )rT  r   rS   r  )r  r  r   r   r   r   r   r   r  r   r'  r   r   r   r   r   rS   r  )r  r  r   r;  rS   r   )r  r  rK  r   rS   r   )r   r   r   r   r  r   rd   r   r$  r  r  rn  r_  r`  r  r!  r"  r#  rC  staticmethodrz  r{  r  r  r  r  r  r   rY   rW   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    \  rY   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   rS   r\   c                V    || _         t                                                       d S r^   )_type_of_anyrc   rd   )re   r  rf   s     rW   rd   z ChangeExplicitTypeOfAny.__init__  s'    'rY   r  r9   r=   c                f    |j         t          j        k    r|                    | j                  S |S )N)r  )r  r>   r   r   r  )re   r  s     rW   	visit_anyz!ChangeExplicitTypeOfAny.visit_any  s.    =I...??t/@?AAAHrY   )r  r   rS   r\   )r  r9   rS   r=   )r   r   r   r   rd   r  r   r   s   @rW   r  r    sW        FF            rY   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  rK  r   c	                v    || _         || _        || _        || _        || _        || _        || _        || _        d S r^   )r  r  r   r  r  r  rK  r   )	re   r  r  r   r  r  r  rK  r   s	            rW   rd   zModelConfigData.__init__  sF     ). 0!2 0#6 rY   rS   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      rW   r   z3ModelConfigData.get_values_dict.<locals>.<dictcomp>  s    HHHA!-1---rY   )__dict__rB  r   s    rW   r%  zModelConfigData.get_values_dict  s'    
 IH!4!4!6!6HHHHrY   r   r  r\   c                    |dS |                                                                 D ]\  }}t          | ||           dS )z$Update Pydantic model config values.N)r%  rB  r   )re   r   r  r  s       rW   rD  zModelConfigData.update  sV    >F**,,2244 	  	 DAqD!Q	  	 rY   r   rR   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   )re   r   r-  s      rW   rO  zModelConfigData.setdefault  s2    4%D#u%%%%% &%rY   )NNNNNNNN)r  r   r  r   r   r   r  r   r  r   r  r   rK  r   r   r   r   )r   r  rS   r\   )r   rR   r-  r   rS   r\   )r   r   r   r   rd   r%  rD  rO  r   rY   rW   r;  r;    s        22 %)"'+(,)-(,+/"    (I I I I       & & & & & &rY   r;  r   r*   r   c                6    |                      t                    S )zXReturn whether the type info is a root model subclass (or the `RootModel` class itself).)rm   ROOT_MODEL_FULLNAME)r   s    rW   r   r     s    ==,---rY   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)rJ  	ERROR_ORM)r  r   r   s      rW   r   r     s-    HHAAAA7QZH[[[[[rY   r   r2   c                H    |                     d|  d|t                     dS )z0Emits an error when the config value is invalid.zInvalid value for "Config.r  r  N)rJ  ERROR_CONFIG)r   r   r   s      rW   r  r    s,    HH1$1117HNNNNNrY   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)rJ  ERROR_ALIASr   r   s     rW   rL  rL    s#    
 HH2G+HNNNNNrY   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)rJ  ERROR_UNEXPECTED)r   r   r   linkfull_messages        rW   r   r     sO    
 DDWVWWWL\T\\\\LHH\7)9H:::::rY   c                @    |                      d|t                     dS )z;Emits an error when there is an untyped field in the model.zUntyped fields disallowedr  N)rJ  ERROR_UNTYPEDr  s     rW   rx  rx    s!    HH('HFFFFFrY   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)rJ  ERROR_EXTRA_FIELD_ROOT_MODELr  s     rW   ra  ra    s"    HHA7QmHnnnnnrY   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   r1  r  rk   rl   r   rE  rF  remover2   r  named_generic_typer?   rC   r   r+   r   r   r  r   r   r   r:   	variablesr   r"   r4   r   r:  rg   r  r   rD   is_decoratedr  r   r!   r'   r   defn)r   r   r   r   r  r   r  r  r   rp   function_typefirstr  r,  r  r   	signaturer9  r_namer  decs                        rW   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",---*+++""""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$$$$$rY   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)
ry   sysversion_infotomllibtomliImportErrorwarningswarnopenload)r   toml_r  rfs       rW   r   r   M  s   
 (( t
7""	!!!!! 	 	 	OOOMMfggg44		 
k4	 	  Bzz"~~                 s!   3 #AA-BBB)rQ   rR   rS   rT   )r|   r/   rS   r=   )r   r*   rS   r   )r  rR   r   r-   r   r   rS   r\   )r   rR   r   r2   r   r   rS   r\   )r   r2   r   r   rS   r\   )r   rR   r   r  r   r   rS   r\   )r   r-   r   r   rS   r\   )NNF)r   r  r   r   r   rR   r   r  r  r=   r   r   r  r  r  r   rS   r\   )r   rR   rS   r  )r   
__future__r   r  collections.abcr   configparserr   typingr   r   r   mypy.errorcodesr	   mypy.expandtyper
   r   
mypy.nodesr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   mypy.optionsr,   mypy.pluginr-   r.   r/   r0   r1   r2   mypy.plugins.commonr3   mypy.semanalr4   mypy.server.triggerr5   
mypy.stater6   mypy.type_visitorr7   mypy.typeopsr8   
mypy.typesr9   r:   r;   r<   r=   r>   r?   r@   rA   rB   mypy.typevarsrC   	mypy.utilrD   mypy.versionrE   mypy_versionpydantic._internalrF   pydantic.versionrG   r   r   rn   r   r  rs   r  DATACLASS_FULLNAMEr6  rw  r5  MYPY_VERSION_TUPLEr  rX   rV   r_   rz   r   r  r   r  r;  r   r  r  r  r  r  ERROR_FIELD_DEFAULTSr  r   r  rL  r   rx  ra  r  r   r   rY   rW   <module>r4     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\# # # #4MT MT MT MT MT MT MT MT`
 
 
 
 
 
 
 
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     rY   