ML iFUdZddlmZddlmZddlmZmZddlm Z ddl m Z m Z m Z ddlZddlmZdd lmZdd lmZmZdd lmZmZdd lmZdd lmZddlmZm 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/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;ddlmZ>m?Z?m@Z@mAZAmBZBmCZCddlDmEZEddlFmGZGddlHmIZImJZJmKZKmLZLddlMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^ddl_m`Z`ddlambZbhdZcdedd<dhZededd<ddhZfdedd<hdZgdedd <hd!Zhdedd"<d#d$hZidedd%<d&Zjdedd'<d(Zkdedd)<d*Zldedd+<d,Zmdedd-<Gd.d/ZnGd0d1ZodQd2Zp dR dSd3ZqdTd4Zr dU dVd5Zs dVd6ZtdWd7Zu dXd8ZvdYd9ZwdQd:Zx dZd;Zyd[d<Zz d\d=Z{ d]d>Z| d^d?Z}d_d@Z~ d`dAZdadCZdbdDZ dcdEZ dddFZdbdGZdbdHZdTdIZGdJdBZdedKZdfdLZ dgdMZdhdNZdidOZdidPZy)jz>Plugin for supporting the attrs library (http://www.attrs.org)) annotations) defaultdict)IterableMapping)reduce)FinalLiteralcastN)apply_generic_arguments) LITERAL_REQ) expand_typeexpand_type_by_instance)TypeTranslationErrorexpr_to_unanalyzed_type) meet_types)format_type_bare) ARG_NAMED ARG_NAMED_OPTARG_OPTARG_POSMDEFArgumentAssignmentStmtCallExprContext Decorator ExpressionFuncDef IndexExprJsonDict LambdaExprListExpr MemberExprNameExprOverloadedFuncDefPlaceholderNodeRefExprSymbolTableNodeTempNode TupleExprTypeApplicationTypeInfo TypeVarExprVar is_class_var)SemanticAnalyzerPluginInterface) _get_argument_get_bool_argument_get_decorator_bool_argumentadd_attribute_to_classadd_method_to_classdeserialize_and_fixup_type)make_wildcard_trigger)state) get_type_varsmake_simplified_unionmap_type_from_supertypetype_object_type)AnyType CallableType FunctionLikeInstance LiteralTypeNoneType Overloaded ProperType TupleTypeType TypeOfAnyTypeType TypeVarId TypeVarTypeUninhabitedType UnionTypeget_proper_type) fill_typevars)unmangle>attr.s attr.attrsattr.attributesrattr_class_makerszattr.dataclassattr_dataclass_makersz attr.frozenz attrs.frozenattr_frozen_makers> attr.define attr.mutable attrs.define attrs.mutableattr_define_makers>attr.ib attr.attr attr.field attr.attrib attrs.fieldattr_attrib_makerszattr.converters.optionalzattrs.converters.optionalattr_optional_converters_ATSELF_TVAR_NAME__attrs_attrs__MAGIC_ATTR_NAMEz__{}_AttrsAttributes__MAGIC_ATTR_CLS_NAME_TEMPLATE__attrs_init__ATTRS_INIT_NAMEceZdZdZdddZy) Converterz/Holds information about a `converter=` argumentNc ||_||_yN) init_typeret_type)selfrmrns X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypy/plugins/attrs.py__init__zConverter.__init__hs"  NN)rm Type | NonernrtreturnNone)__name__ __module__ __qualname____doc__rqrrrprjrjes 9!rrrjczeZdZdZ ddZd dZd dZe d dZd dZ y) AttributezThe value of an attr.ib() call.c ||_||_||_||_||_||_||_||_| |_yrl) namealiasinfo has_defaultinitkw_only convertercontextrm) rorrrrrrrrrms rprqzAttribute.__init__psD   &  " "rrcv|jsJd}|jr|jjr|jj}|r|jr |jjrt |jj}t |j}|rt |t |k(rt ||Dcic]\}}|j|}}}t||}nq|jjd|jttj}n1|jxs#|j|j j"}d}|d}ttj$}n:t'|} t)| tr| j*tj$k(rd}|rw|jj,j.rW|j|j j0} | J|jj2j5| |j|j6r|j8rt:nt<} n|j8rt>nt@} |jBxs|j jEd} tGtI| ||d| Scc}}w)z1Return this attribute as an argument to __init__.Nz-Cannot determine __init__ type from converterFT_)%rrrmrnr9lenzipidr apifailrr=rG from_errorrrtype unannotatedrM isinstance type_of_anyoptionsdisallow_untyped_defsnodemsgneed_annotation_for_varrrrrrrrlstriprr.) roctxrmconverter_vars init_varsbinderarg variablesr proper_typerarg_kindrs rpargumentzAttribute.arguments yyy!% >>~~'' NN44 DNN4K4K&34>>3J3J%KN -dnn =I%#n*=Y*O>A.R[>\%/:vsFIIsN% %%0 9$E  Ldll[#I$8$89 C$))DII*>*C*CI  K 5 56I))4K+w/**i.C.CC"&K 377??@@ 99TYY',,D# ## GGKK / /dll C <<(,(8(8}iH"&"2"2wHzz2TYY--c2D),ixHHK%s J5c |j|j|j|j|j|j du|j r:|j j r$|j j jnd|jj|jj|j r|j jd Sdd S)z6Serialize this object so it can be saved and restored.N) rrrrr has_converterconverter_init_type context_linecontext_columnrm) rrrrrrrm serializerlinecolumn)ros rprzAttribute.serializesIIZZ++II||!^^47>>dnn&>&>((224 LL--"ll117;~~113  LP  rrc|d}|r t||nd}|d}|r t||nd}t|d|d||d|d|d|d r t|ndt|d |d  | S) z)Return the Attribute that was serialized.rmNrrrrrrrrr)rr)r6r}rjr)clsrdatar raw_init_typermraw_converter_init_typers rp deserializezAttribute.deserializes [) FS.}cBY] "&'<"=' ''> D   L M    L O.2?.CI) * n-d;K6L M   rrcx|jr't|j||j|_yd|_y)zoExpands type vars in the context of a subtype when an attribute is inherited from a generic super type.N)rmr;r)rosub_types rpexpand_typevar_from_subtypez%Attribute.expand_typevar_from_subtypes* >>4T^^XtyyYDN!DNrrN)rstrrz str | Nonerr,rboolrrrrrConverter | Nonerrrmrtrurv)rmypy.plugin.ClassDefContextrur)rur )rr,rr rr0rur})rr,rurv) rwrxryrzrqrr classmethodrrr{rrrpr}r}ms)### #  #  ##$### #,2Ih &  #+ 2Q   2"rrr}c4t|d}t|d}t|d}|7t|du|dufr&|jjd|j||S|d}||}|dur*|dur&|jjd|j|S) zh Validate the combination of *cmp*, *eq*, and *order*. Derive the effective value of order. cmpeqorderNz%Don't mix "cmp" with "eq" and "order"TFz eq must be True if order is True)%_get_decorator_optional_bool_argumentanyrrreason)rrrrs rp_determine_eq_orderrs 0U ;C .sD 9B 1#w ?E 3$T0ABC  =szzJ   z  } U{u}  7D LrrcRt|jtrt|j|}|rrt|tr0|j dk(ry|j dk(ry|j dk(ry|j jd|d|jt |S|S|S) zqReturn the Optional[bool] argument for the decorator. This handles both @decorator(...) and @decorator. z builtins.TrueTzbuiltins.FalseFz builtins.NoneN"z1" argument must be a True, False, or None literalcode) rrrr1r$fullnamerrr )rrdefault attr_values rprr s#**h'"3::t4 *h/&&/9&&*:: &&/9 GGLLD6JK     NrrcJi|jjjd<y)zRecord that we have an attrs class in the main semantic analysis pass. The later pass implemented by attr_class_maker_callback will use this to detect attrs classes in base classes. attrs_tagN)rrmetadatars rpattr_tag_callbackr)s*,CGGLL+&rrctj|jjj5t ||||cdddS#1swYyxYw)aAdd necessary dunder methods to classes decorated with attr.s. attrs is a package that lets you define classes without writing dull boilerplate code. At a quick glance, the decorator searches the class body for assignments of `attr.ib`s (or annotated variables if auto_attribs=True), then depending on how the decorator is called, it will add an __init__ or all the compare methods. For frozen=True it will turn the attrs into properties. Hashability will be set according to https://www.attrs.org/en/stable/hashing.html. See https://www.attrs.org/en/stable/how-does-it-work.html for information on how attrs works. If this returns False, some required metadata was not ready yet, and we need another pass. N)r8strict_optional_setrrstrict_optionalattr_class_maker_callback_impl)rauto_attribs_defaultfrozen_default slots_defaults rpattr_class_maker_callbackr3sI,  " "377??#B#B C . %~}    s A  Ac |jj}t|dd}t||}t |}t|d|}t |d|} t|dd} t|dd} |jjj dd D]!} d | jvsd | jvs!yt|| | } | D],}|j|j}|!t|yt|| Dcgc]'}|j||jjf)c}|r t|| | r2|jj j"dd d k\r t%|| | Dcgc]}|j'c}|d|jjjd <t)|}t+|| ||rdnt,|r t/|||r)t1|| t|ddxr t|dd}nt |d}| t |d}t |d}d|jjj2v}|s||dur y|rR|jjj d j2d|jjj2d<yt5|ycc}wcc}w)NrTslots auto_attribsrF match_argsrattrs)  attributesfrozenrqhash unsafe_hashr__hash__)rrr3 _get_frozenrrmror_analyze_classgetr_add_empty_metadata_add_attrs_magic_attributer _add_slotsrrpython_version_add_match_argsr MethodAdder _add_initrh _add_order _make_frozennames_remove_hashability)rrrrrrrrrrrr super_inforattrradderhashabler has_own_hashs rprrQs 77<,K 7Kct|d|ry|jjjddD]%}d|jvs|jdds%yy)z$Return whether this class is frozen.rTrrrF)r3rrrr)rrrs rprrs]#C>Bggll&&q, j)) )j.A.A'.J8.T rrci}| t|}|jjjD]o}t |t r@t ||||D].}|s|j|vr ||j=|||j<0St |tsdt||q|jD]}|j|jjjvs0|jjj|jj}t |trxt |tsJ|d|_t#|}g} |jjj$ddD]} d| j&vs|j(j+t-| j.| j&ddD]|} | d|vs t0j3| | |j(} | j5|jj| j7| |j9| j~| t;|jz} d}t=| D]~\}}|j>s|j@r |tC| k\r |jDn |j}|jFs|r|j(jId|||jFz}| S)aIAnalyze the class body of an attr maker, its parents, and return the Attributes found. auto_attribs=True means we'll generate attributes from type annotations also. auto_attribs=None means we'll detect which mode to use. kw_only=True means that all attributes created here will be keyword only args in __init__. Frrrrrz!$)),'+ $))$ ,i ( tY / 0%%' 1  >>SWW\\// /77<<%%inn5::D$0dC( .$ .(+0D ( 19~Kggll&&q, 1 j)) ) GG ) )*? @S@S*T U"++G4\B 1<'77!--j$HA11#'',,?&&q)$((0 1 1tI$4$4$677JL!*-. 9~~     ()C ,<'<)###''$$ GGLLWY` a --- . rrc(gdd|jd<y)zEAdd empty metadata to mark that we've finished processing this class.FrrN)r)rs rprrs,.%@DMM'rrc|jjjD]}t|ts|j D]}t ||\}}t|t|k7r*t||D]^\}}t|tst|jts2|jjtvsO|jr\yy)zyReturn whether auto_attribs should be enabled or disabled. It's disabled if there are any unannotated attribs() FT)rrrrrlvalues_parse_assignmentsrrrcalleer'rr` new_syntax)rrlvaluerrvalueslhsrvalues rprrs  !!% dN +,, %#5fd#C w<3w</#&w#8 %KC#684&v}}g>"MM226HH $ % % %%* rrc #K|jD]}t||\}}t|t|k7r*t||D]\}}t |t rNt |j tr4|j jtvrt||||||} | s_| d|sg|jst|jst|rt|||||yw)a@Return Attribute objects that are created by this assignment. The assignments can look like this: x = attr.ib() x = y = attr.ib() x, y = attr.ib(), attr.ib() or if auto_attribs is enabled also like this: x: type x: type = default_value x: type = attr.ib(...) N)rrrrrrrr'rr`_attribute_from_attrib_makerrrr/_attribute_from_auto_attrib) rrrrrrrrrrs rprrs,,S-fd; w<3w< ' w0 SKC68,v}}g6MM**.@@3CwPSU[]abJ$)) UXHY1#wVTRR SSs$B!C($C(, C(9 C( C(C(cg}|jD]}t|tst|jts/|jj |vsH|j dk(rd||jj _|j dvs|j||D]}|jj|y)zHandle decorators in class bodies. `x.default` will set a default value on x `x.validator` and `x.default` will get removed to avoid throwing a type error. rT)r validatorN) decoratorsrr#exprr$rrrremove)rattr_map remove_mefunc_decoratordecs rprr?s I//1 ~z 2>..9##((H4""i/AE,,112>""&>>  0%1&$ s#$rrc t|j}t|t }|jj j j|}|r |jnd}t|d|jj |d|d|| S)z.Return an Attribute for a new type assignment.NT) rOrrr)rrrrrr}) rrrrrrhas_rhssymrms rprr]sp CHH DVX..G '',,    &CTI T4wgtTS\ ]]rrc |rK|js?|jJ|jjj |j|yt |j dkDr|jjd|y|j}t||dd}|t||ddz}tt|d}tt|d } |r| r|jjd |n| rd}t|d } | r|s t| |jj|jj} |jj| }|rIt!|jt"r/|jjs||j_d|_ t|d } t|d} | r| r|jjd|n | r|jjd|| } t)|| }d}t|d}|r?|jj+|}|"|jjd|t,t/|j0}t3|||j4j6|||||| S#t&$r |jjd | YwxYw)zFReturn an Attribute from the assignment or None if you can't make one.Nrz Too many names for one attributerTrFrfactoryz(Can't pass both "default" and "factory".rzInvalid argument to typerconvertz*Can't pass both "convert" and "converter".z$convert is deprecated, use converterrz8"alias" argument to attrs field must be a string literalr)rrrrrrrrrr2rr1rr is_stub_file anal_typerr.is_inferred_defr_parse_converterparse_str_literalr rOrr}rr)rrrrrrrmrattr_has_defaultattr_has_factorytype_argun_typerr*converter_infor alias_exprrs rprrms`DOOxx###  ++CHHd; 4<<1  7> I c664 8D !#vy%@@GM&)<=M&)<=,  @&I VV,H  ,-hI]I]^G))'2IZ#6sxx}} ) &+#fk2IFI.G9  BFK   ;VD %c95N Evw/J))*5 = GGLLJ    CHH D  eSWW\\#3T7NTXZc ?$ ? GGLL3X > ?s5J%KKcl|syt}t|trct|jtrI|jj t vr-|jr!|jdr|jd}d}nd}d}t|tr&|jrt|jtrr|jjrr ttj|_|S|s<|j(jAd|ttjB|_|StE|}t|t4r4|jFr(|jFd|_|s|jH|_$nt|tJrg}|jLD]]}tO|jF}|s|dkDr tQd|jRddDr@|jU|jFd_|rtW||_|r:|jr.tYjZ|jt]g|_|S)z/Return the Converter object from an Expression.NrTFzVUnsupported converter, only named functions, types and lambdas are currently supportedrc3.K|] }|tk(ywrl)r).0kinds rp z#_parse_converter.. s(XT(Xs)/rjrrrr'rraargsrrrr?r=rGrrmr%is_valid_overloaded_converterr,r<r named_typeranalyzedr+baser>r typesrincompatible_typevar_valuer!rrrM arg_typesrnrCitemsrr arg_kindsrr:rL make_unionrB)rconverter_exprr4is_attr_converters_optionalconverter_typer@item num_arg_typess rpr.r.sD [N>8, ~,,g 6  ! ! * *.F F       "(,,Q/&*#&+#"&N.'*~/B/B n))7 3""''J~7J7J7O7OQ],^!/!4!4!9!9+293H3H+I(%% ++-> ?Da   E ,0055N ++X 6-n.A.A377CUCUVN>9- ~.. @ ~**G 4 ~**// :*.*=*=*B*BCGGDVDVW nl 34''-- 66 N"N.*-#*9+@+@#A       $+9+?+?#@ $^4N.,/N4L4L#1#;#;A#> *&4&=&=N # NJ /"(( ,D/M q S(XT^^TUTVEW(X%X LL* + , '.s9 i ( ( TJtyy~~|,T TsAA)allrC)defns rpr<r<s JJ rrclg}g}t|ttfrwtd|jDr!t t t|j}t|jttfr|jj}||fSt|tr|g}|jg}||fS)zSConvert a possibly complex assignment expression into lists of lvalues and rvalues.c3<K|]}t|tywrl)rr$rNs rpr:z%_parse_assignments..)sCdz$)Cs) rr*r"rOrCr rr$r)rrrrs rprr"s!G "G&9h/0 CfllC C4>6<<8G dkkIx#8 9kk''G G  FH %(;;- G rrrc |jjd}|jjd}|jjjdt }t t |tddg|ttj}tt |g|ttj}tt||jjjt <dD]}|jjjd|}|jt|j j"| }t%t'd ||d t(g} |j+|| ||| y ) z1Generate all the ordering methods for this class.z builtins.boolzbuiltins.object.r) namespace)rr upper_boundr)__lt____le____gt____ge__)rotherN) self_typetvd)rr=rrrrcrJrIr=rGfrom_omitted_genericsr-r(rr copy_modifiedrraw_idrr.r add_method) rr bool_type object_typerr^self_tvar_exprmethodrVr;s rprr3sC""?3I''$$%67K '',,''(.)9:H  R2 & 778 C!"k79;Z;Z3[N*9~)NCGGLL~&:Jww||,,-Qvh7 9SVV]]i#PQWc*Cw?@ yCSI Jrrcp|D]0}|j|jjjvrP|jjj|jj}t |t sxd|_t |j|j}|jj|_|jjjd|j|_ tt||jjj|j<d|_3y)zCTurn all the attributes into properties to simulate frozen classes.TrTN) rrrrrrr. is_propertyrmr _fullnamer(r)rrr rvars rprrQs# >>SWW\\// /77<<%%inn5::DdC(#D inni&9&9:Cww||CH"ww||445QsxxjACM+:4+ECGGLL  sxx ("CO##rrcg}g}|jjj}|D]}|js|jr!|j |j |n |j |j ||jrj|j|vsy||jj}t|ts|jsd|_ ||z} td| DrM| D]H} tt j"| j$_tt j"| _J|j+|| t-y)zGGenerate an __init__ method for the attributes and add it to the class.Tc3K|]6}t|jjddtjk(8yw)rN)getattrvariablerrGr)r8rs rpr:z_add_init..s8    !!=$79;P;PP  s<>N)rrrrrrrrrrrr.is_finalfinal_set_in_initrOr=rGimplementation_artifactrnrtype_annotationrbrB) rrr method_namepos_args kw_only_args sym_tabler sym_noder;r s rprrgs,HL ""I 2 ~~        2 23 7 8 OOI..s3 4$$9)D 055H(C(X->->-1* 2 l "D      KA%i&G&GHAJJO ' (I(I JA  K [$ 3rrc ttj}|Dcgc]*\}}|jj d|xs|gxs|,}}}|jj d|jj d|gxs|g}t j|jjjdd}|jj||d}t||D]m\\} }}t| |} | | _d| _t!|} t#| t$r| j&| _t+t,| d|j.| <ot%|g} t+t,|d|jj(j.|<t1|j|jt2t5|| |jjdt2dd ycc}}w) Nzattr.Attributebuiltins.tuplerTrrT)plugin_generatedfallback)roverride_allow_incompatible is_classvar)r=rGexplicitrnamed_type_or_noner=rfformatrrreplacebasic_new_typeinforr.rirhrMrr@rrr(rrr4rerE) rrany_typer attr_typeattributes_types fallback_type attr_nametirrjrattributes_types rprrsy))*H"$ Ay ""#3i6K85LMYQYY$$GG&&377556F S_W_`M-33CGG4D4D4L4LSRU4VWI  # #I}a @B #E+; <K q9$ " %i0 k8 ,"''CH(sTJKr2&O%4D"t$TCGGLLy!  "_=GG$$%Q&78$(1$s/G1ctd|jjjddDry|Dchc]}|jc}|jj_t |Dcgc]}|jjdc}|jjd}t|j|jd|ycc}wcc}w) Nc38K|]}|jduywrl)r)r8ps rpr:z_add_slots..s ;q177d? ;srr builtins.strryr{ __slots__rrrtyp) rrrrrrrErr=r4)rrrr slots_types rprrs ;CGGLL$4$4Qr$: ;; 1;;$));CGGLL5?@  N +@##$45JswwCGG+:V< As C1"Cc  d|jjjvs-|jjjdjr|jj d}t |Dcgc]A}|js3|jr'|jt|j|Cc}|jj d}t|j|jd|yycc}w)N__match_args__rr{)last_known_valueryr) rrrrzrr=rErrr`rArr4)rrstr_typerrs rprrs 2 22 77<<  . / @ @77%%n5' || && DIIX`8a&b  WW''(89   377>NT^_ A s4ADc^t|j|jdtddy)z Remove hashability from a class.rT)r~overwrite_existingN)r4rrrBrs rprrs" *hjdW[rrc<eZdZdZddZ d ddZy)rznHelper to add methods to a TypeInfo. ctx: The ClassDefCtx we are using on which we will add methods. cZ||_t|jj|_yrl)rrNrrr])rors rprqzMethodAdder.__init__s&sww||4rrNc ||n |j}t|jj|jj|||||y)zAdd a method: def (self, ) -> ): ... to info. self_type: The type to use for the self argument or None to use the inferred self type. tvd: If the method is generic these should be the type variables. N)r]r5rrr)rorsr;rnr]r^s rprbzMethodAdder.add_methods<"+!6IDNN  HHLL$((,, T8YPS rrrrrurvrs) rsrr;zlist[Argument]rnrFr]rtr^zTypeVarType | Nonerurv)rwrxryrzrqrbr{rrrprrsS5"&"&            rrcD|jjt}| |jsy|jj dxs|jj t }t |trt |jtsy|jS)zT If `typ` refers to an attrs class, get the type of its initializer method. Nrq) rrrerz get_methodrhrrr>)r magic_attr init_methods rp_get_attrs_init_typersxo.J!N>NP\3]   rrcVt||jj}||urt|trd|dnd|d}nBt||jj}t|tr d|d|dnd|d|d}|jj ||j y) Nz,Argument 1 to "evolve" has a variable type "z" not bound to an attrs classz.Argument 1 to "evolve" has incompatible type "z"; expected an attrs classz!Argument 1 to "evolve" has type "z" whose item "z " is not bound to an attrs classz" is not an attrs class)rrrrrJrr)rtparent_tt_namerpt_names rp_fail_not_attrs_classrs a 1F1}![);6(B_ `A&Icd #8SWW__=![)0yvhNn oA'.Y_X``wx GGLLckk"rrc>t|tryt|tr>g}|jD]'}t |}t ||||}||||z }&d})|St|t r!t |t |j||St|trpt|}|t|||yt||}ttt|jdd}|j dd} t#t%|| gSt|||y)a  For a given type, determine what attrs classes it can be: for each class, return the field types. For generic classes, the field types are expanded. If the type contains Any or a non-attrs type, returns None; in the latter case, also reports an error. Nr)rr=rLrelevant_itemsrM_get_expanded_attr_typesrJrWr@rrrr rr arg_namesrBdictr) rr display_typ parent_typretrI item_types init_func field_names field_typess rprr!s%#w C #/1&&( D"4(D1#tT:NJ:#9z!   C %' 1;    C "(-   !#{J ?+Is; 49i&9&9!"&=> ))!"- Sk2344c; ;rrc Jtt}|D].}|jD]\}}||j|0|jDcic]@\}}|t |t |k(rt t t|n tBc}}Scc}}w)zr "Meet" the fields of a list of attrs classes, i.e. for each field, its new type will be the lower bound. ) rrrCrrrMrrrK)r@field_to_typesfieldsrrf_typess rp _meet_fieldsrKs!&N- -ID# 4 ' ' , --,113   D' 7|s5z) F:w7 8 " #  sABc t|jdk7rJ|jjd|jj d|j |jSt|jddk7r |jS|jdd}t|jj|}t||jj}t||||}| |jSt|}tdg|jtgt gt|zz|g|j#||jj$|jj d|S) z Generate a signature for the 'attr.evolve' function that's specific to the call site and dependent on the type of the first argument. rrz " has unexpected type annotationrrinstz of )rrDrBrnr|r)rr;rrdefault_signaturerrrMget_expression_typerrrrr>keysrrrr|)rinst_arg inst_type inst_type_str attr_typesrs rpevolve_function_sig_callbackr^sL  388}  q..3344TUWZWbWbc$$$ 388A;1$$$xx{1~H ; ;H EFI$Y@M)#y)YOJ$$$ * %F *FKKM*)}oF ;;/v}}/&&//%%**+4  ?  rrc*t|jdk7st|jddk7r |jSt|jj |jdd}t |ts*t |tr&t |jtr |jSd}|jj}t |tr5t|j}t |tr0|g}|j}n t |tr|j!}|Pt"|j$vr>|j$t"j}|J|jj'||S|jS)z)Provide the signature for `attrs.fields`.rrN)rBrn)rr;rrMrrrr=rHrIrBrJrWr@rr> type_objectrerr`)rrrrBinnerrns rpfields_function_sig_callbackr~sD 388}S!-2$$$!#''"="=chhqk!n"MNK ;( k8 , {'' 1$$$ C%%//I+{+ 7 78 eX &$ I**C K .%%' ?cii799_-22###$$22YQY2ZZ   rr)rrrurrl)rrrrr bool | Nonerurr)FFF) rrrrrrrrrur)rrrrrur)rrrrrrrulist[Attribute])rr,rurv) rrrrrrrrruzIterable[Attribute])rrr!zdict[str, Attribute]rurv) rrrrrr$rrrrrur})rrrrrrrr$rrrrruzAttribute | None)rrrFzExpression | Nonerur)rPr%rur)rrrrruz'tuple[list[NameExpr], list[Expression]])rrrrrurv)rrrrrurv) rrrrrrrsz%Literal['__init__', '__attrs_init__']rurv)rrrzlist[tuple[str, Type | None]]rurv)rr@ruzCallableType | None)rmypy.plugin.FunctionSigContextrrFrrFrurv) rrrrDrrDrrDruzlist[Mapping[str, Type]] | None)r@zlist[Mapping[str, Type]]ruzMapping[str, Type])rrrur>)rz __future__r collectionsrcollections.abcrr functoolsrtypingrr r mypy.pluginmypymypy.applytyper mypy.errorcodesr mypy.expandtyper rmypy.exprtotyperr mypy.meetr mypy.messagesr mypy.nodesrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0mypy.plugins.commonr1r2r3r4r5r6mypy.server.triggerr7 mypy.stater8 mypy.typeopsr9r:r;r< mypy.typesr=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrM mypy.typevarsrN mypy.utilrOrS__annotations__rTrUrZr`rarcrerfrhrjr}rrrrrrrrrrrrrr.r<rrrrrrrrrrrrrrrr{rrrprsD"#-''2'@I *>86 &(G5F 01u1*N;E;\E\`E`#=?Z"[%[**&>e>))!!@"@"F<IM $,/:E8,).   $ %      #&' '' '' ' % 'T&@!!rr