bgA  UdZddlmZddlZddlZddlZddlZddlZddlm Z m Z m Z m Z ddlm Z mZmZmZmZddlmZmZmZmZmZmZmZddlmZddlmZmZmZm Z dd l!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*dd l+m,Z,dd l-m.Z.dd l/m0Z0m1Z1m2Z2e rdd l3m4Z4ej5dZ6edZ7edej8Z9edej:Z;ej e1ee1eej<ej=fe1ee1eegdfZ> dddZ?e?ej@_Ae?ejB_Ae?ejC_Ae?ejD_Ae?ejE_A dddZFejG ddd ZHeHejI_AeHejJ_AeHejK_A ddd#ZLdd'ZMdd(ZNeLejO_Add+ZP ddd.ZQejGejReQejS_AeQejT_UejGejR ddd1ZVeVejW_AejGejR ddd7ZXeXejY_AejGejR ddd9ZZeZej[_A ddd;Z\ejGejRe\ej]_AejGe\ej^_UejGejR ddd=Z_e_ej`_AeaZb ddd@ZcejGejRecejd_AejGecejd_UejGejR dddBZeeeejf_AddGZg dddJZhejGejR dddKZiehejj_heiejj_AddLZkddRZlddYZm ddd^Zn ddd_ZoddcZpddZqddeZrddkZsddmZtddqZu dddsZvejwejR dddtZxevej=_vexej=_Aejyejzej{ej|ej}ej~dudvdwZdxedy<dzd{hZdd|ZddZ dddZeej_A dddZejGejR dddZeej<_eej<_AejG dddZeej_AejGejR dddZeejT_Aeej^_AejGejR dddZeej_AddZejG dddZeej_A dddZeej:_AdS)zMThis module contains a set of functions to handle inference on astroid trees.) annotationsN)Callable GeneratorIterableIterator) TYPE_CHECKINGAnyOptionalTypeVarUnion)bases constraint decoratorshelpersnodes protocolsutil) PY310_PLUS) CallContextInferenceContextbind_context_to_node copy_context) AstroidBuildingError AstroidErrorAstroidIndexErrorAstroidTypeErrorAstroidValueErrorAttributeInferenceErrorInferenceErrorNameInferenceError_NonDeducibleTypeHierarchy) dunder_lookup)AstroidManager)InferenceErrorInfoInferenceResultSuccessfulInferenceResult)Propertyobjects_T_BaseContainerT)bound _FunctionDefT?list[functools.partial[Generator[InferenceResult, None, None]]]selfcontextInferenceContext | Nonekwargsr return Iterator[_T]c+K|VdS)zInference's end for nodes that yield themselves on inference. These are objects for which inference does not have any semantic, such as Module or Consts. Nr.r/r1s b/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/astroid/inference.py infer_endr8Fs JJJJJnodelist[SuccessfulInferenceResult]cg}|jD]}t|tjrqt j|j|}|st||t|dst||| t|t|tj rCt j|j|}|st||| || ||S)z.Infer all values based on _BaseContainer.elts.r:r/elts) r> isinstancerStarredr safe_infervaluerhasattrextend_infer_sequence_helper NamedExprappend)r:r/valueseltstarredrBs r7rErEZsFy c5= ) ) (G<z!infer_sequence..xsF!!<= 1u}eo677!!!!!!r9)lineno col_offsetparent)anyr>rEtyperRrSrTpostinit)r.r/r1has_starred_named_exprrHnew_seqs r7infer_sequencerZrs !!!AE!!! 'g66$t**;4?4;         r9 nodes.DictIterator[nodes.Dict]c#4Ktd|jDs|VdSt||}t||j|j|j}|t||VdS)Nc3PK|]!\}}t|tjV"dSrN)r?r DictUnpack)rOk_s r7rQzinfer_map..s3FF41az!U-..FFFFFFr9) rUitems _infer_maprVrRrSrTrWlist)r.r/rbrYs r7 infer_mapres FF4:FFF F F 4))$t**T[$/4;GGekkmm,,--- r9lhs_dict:dict[SuccessfulInferenceResult, SuccessfulInferenceResult]rhs_dictctj||}d|D}t|S)aDelete nodes that equate to duplicate keys. Since an astroid node doesn't 'equal' another node with the same value, this function uses the as_string method to make sure duplicate keys don't get through Note that both the key and the value are astroid nodes Fixes issue with DictUnpack causing duplicate keys in inferred Dict items :param lhs_dict: Dictionary to 'merge' nodes into :param rhs_dict: Dictionary with nodes to pull from :return : merged dictionary of nodes cBi|]\}}|||fSr5) as_string)rOkeyrBs r7 z,_update_with_replacement..s*PPPJC#--//C<PPPr9) itertoolschainrbdictrH)rfrh combined_dict string_maps r7_update_with_replacementrssV&OHNN$4$4hnn6F6FGGMPP-PPPJ  !!## $ $$r9ci}|jD]\}}t|tjrjt j||}|st t|tjst ||t||}t||}t j||}t j||}td||fDrt ||t|||i}|S)z%Infer all values based on Dict.items.r=r/c3K|]}| VdSrNr5)rOelems r7rQz_infer_map..s$::t8::::::r9) rbr?rr_rrArDictrcrsrU) r:r/rHnamerBdouble_starred unpack_itemsrl safe_values r7rcrcsJLFzII e dE, - - I$/w??N! %$$nej99 A$$@@@@%ng>>L-flCCFF$T7;;;C +E7CCCJ::j(9::::: A$$@@@@-fsJ6GHHFF Mr9 nodes.NodeNGnodes.FunctionDef | Nonec|}|jrLt|jtjs-|j}|jrt|jtj-|r|jr|jSdS)aSearch for the first function which encloses the given scope. This can be used for looking up in that function's scope, in case looking up in a lower scope for a particular name fails. :param node: A scope node. :returns: ``None``, if no parent function scope was found, otherwise an instance of :class:`astroid.nodes.scoped_nodes.Function`, which encloses the given node. N)rTr?r FunctionDef)r:currents r7_higher_function_scoperspG .!GNE~ 4r9nodes.Name | nodes.AssignName&Generator[InferenceResult, None, None]c ||j\}}|skt|}|r||j\}}|s)t |j||t |}|j|_tj|||j |j<tj |||S)z$Infer a Name: use name lookup rules.)ryscoper/) lookupryrrr r lookupnamerget_constraints constraintsr _infer_stmts)r.r/r1framestmtsparent_functionras r7 infer_namers ;;ty))LE5  1>>  9&--di88HAu $YdjjllG 7##GG%/%?e%L%LG "  eWe 4 44r9 nodes.Call4Generator[InferenceResult, None, InferenceErrorInfo]c+Kt|}d|_|'t|||_|j|D]}t|tj r|V! t|dr>t|j |j ||_|||Ed{Vq#t $rY}wxYwt#||S)z?Infer a Call node by trying to guess what the function returns.Ninfer_call_result)argskeywordscallee)callerr/r=)r boundnode_populate_context_lookupclone extra_contextfuncinferr?rUninferableBaserCrrr callcontextrrr$)r.r/r1rrs r7 infer_callrs w''K K$AC  CCT nodes.Importasnamebool#Generator[nodes.Module, None, None]c+2K|p t}|j}|t|| |r,|||VdS||VdS#t $r}t|||d}~wwxYw)z8Infer an Import node: return the imported module/object.Nr=)rrrdo_import_module real_namer)r.r/rr1ryexcs r7 infer_importr s+)++G  D |$8888B  .''t(<(<== = = = = =''-- - - - - - BBB$888cABs,A5A55 B?BBnodes.ImportFromc X|p t}|j}|t|||r; ||}n$#t$r}t|||d}~wwxYw |}n$#t $r}t|||d}~wwxYw t|}||_|||| u}tj ||S#t$r&}tt|||||d}~wwxYw)z;Infer a ImportFrom node: return the imported module/object.Nr=) ignore_localstarget attributer/) rrrrrrrrgetattrrootr rstr) r.r/rr1ryrmodulererrors r7infer_import_fromr:sw+)++G  D |$8888 F F>>$''DD& F F F dG<<<# E FB&&(( BBB$888cABw''!t6TYY[[3HII!%111 " JJttW    sHA A%A  A%)A>> BBB#AC99 D)!D$$D)"nodes.Attribute | nodes.AssignAttrc+XK|j|D]}t|tjr|V!t |}|j} ||_t|tjtj frFt|tjr|n|j }tj |||j|j<||j|Ed{Vn#t"t$t&f$rYnwxYw||_#||_wxYwt)||S)zBInfer an Attribute node by using getattr on the associated object.)rNr=)exprrr?rrrrrClassDefr Instance_proxiedrrrattrnameigetattrrrAttributeErrorr$)r.r/r1owner old_boundnoders r7infer_attributer`sS )).. eT1 2 2 KKK w'')  . %G %%.%.!ABB !+E5>!B!BV5?5O666#DM2~~dmW== = = = = = = = = #       D  !.G   G  - - - - 4 9 9 99s+BC*)D*DDDD D nodes.Globalc &||jt|| tj||j|S#t $r+}tt|||j||d}~wwxYw)Nr=r)rrr rrrrr)r.r/r1rs r7 infer_globalrs ',4$8888!$))++"5"5g6H"I"I7SSS " JJtw/A7    s>A B%&B  Bnodes.Subscript;Generator[InferenceResult, None, InferenceErrorInfo | None]c +tKd}|j|D]}t|tjrtjVdS|j|D]:}t|tjrtjVdSt}|jtj kr|}n0|jtj krtj |}|r|}n|}|turt|| |||}n=#tt t"t$t&f$r} t||| d} ~ wwxYw||ust|tjrtjVdS||Ed{Vd}<|rt)||SdS)zInference for subscripts. We're understanding if the index is a Const or a slice, passing the result of inference to the value's `getitem` method, which should handle each supported index type accordingly. FNr=T)rBrr?rr Uninferableslice_SUBSCRIPT_SENTINEL __class__r rrclass_instance_as_indexrgetitemrrrrrr$) r.r/r1 found_onerBindex index_valueinstance_as_indexassignedrs r7infer_subscriptrsI!!'**(( eT1 2 2 " " " "44Z%%g..$ $ E%!566 &&&&ttt.K%.00# EN22$+$CE$J$J!$4"3K# 111$$@@@@ J ==g>> !!'  J J J%$@@@cI Jx:h8L#M#M&&&&ttt~~g.. . . . . . . .III$ L>!tW==== 4sD#E:E  E nodes.BoolOpc+&K|j}|jdkr tj}n tj} fd|D}n#t $rt jVYdSwxYwtj |D]}td|Drt jV*d|D}td|Drt jV^t j}t||D]\}} || r|Vn|Vt|S)zInfer a boolean operation (and / or / not). The function will calculate the boolean operation for all pairs generated through inference for each component node. orc<g|]}|S)ru)r)rOrBr/s r7 z!_infer_boolop..s'LLLE5;;w;77LLLr9Nc3JK|]}t|tjVdSrNr?rrrOitems r7rQz _infer_boolop..s/GG$z$ 455GGGGGGr9c6g|]}|Sr5) bool_valuers r7rz!_infer_boolop..s":::Tt((:::r9c3JK|]}t|tjVdSrNrrs r7rQz _infer_boolop..s/NN$z$ 455NNNNNNr9r=) rHopoperatortruthnot_rrrrnproductrUzipr$) r.r/r1rH predicateinferred_valuespair bool_valuesrBrs ` r7 _infer_booloprsv[F w$N M LLLLVLLL tt!?3 GG$GGG G G " " " " ::T::: NN+NNN N N " " " "  !$T;!7!7   E:y$$   KKK 4 9 9 99s?AAinfer_callablejCallable[[_T, InferenceContext | None], Generator[InferenceResult | util.BadOperationMessage, None, None]]rtype[util.BadOperationMessage]c#nK|||D]%}t||rtjV!|V&dSrN)r?rr)r.rr/rresults r7_filter_operation_errorsrs^!.w// fe $ $ " " " " "LLLLr9 nodes.UnaryOpFGenerator[InferenceResult | util.BadUnaryOperationMessage, None, None]c#.K|j|D]v} ||jV!#t$r'}t j||j|VYd}~Md}~wt$r}tj |j}|W| }t|t j stj| Vnt jVnt|t jtjfs#t j||j|VYd}~ t'j||}n2#t*$r%t j||j|VYYd}~ZwxYw|d}t-||d}t|t j s|sYd}~t1|}||_t5g||_|||}t-|d} | |Vn| VnM#t*$r'} t j||j| VYd} ~ n!d} ~ wt:$rt jVYnwxYwYd}~pd}~wwxYwdS)3Infer what an UnaryOp should return when evaluated.Nrru)rr)operandrinfer_unary_opr TypeErrorrBadUnaryOperationMessagerrUNARY_OP_METHODrr?rr const_factoryrr rrr"rrnextcallablerrrrrr) r.r/rrmethrmethodsinferred call_resultsr inner_excs r7_infer_unaryopr1s<%%g..6+6+5 +((11 1 1 1 1 G G G/#FF F F F F F F F F0 +0 +0 +,TW5D|%//11 !*d.BCC+-*n======*****!'ENEN+KLL7#NNNNNHHHH+!"/"6w"E"E2!!!";GTWcRRRRR !#1:D#DJJwJ$?$?FFH"8T-ABB!'0022!!*733G(/G%*52h*O*O*OG'#+#=#=dG#=#T#TL!,55F~% $ .UUU7)TTTTTTTTTT%+++******+_0 + 6+6+s~> JA**J8B3J 3E H: 'E80H:7E88AH:AH:9J : JI&!J &JJ JJ  Jc+vKt|t|tjEd{Vt ||S)rNr=)rrrrr$r6s r7 infer_unaryoprnsY ( ngt'D 4 9 9 99r9cRt|tjo |jtuS)z0Check if the given const node is NotImplemented.)r?rConstrBNotImplemented)consts r7_is_not_implementedr ~s eU[ ) ) Kek^.KKr9instance nodes.Constotherr)tuple[util.UninferableBase | nodes.Const]ctt|tjritj|jvr tjfSfd|jD}t d|Drtd|D}nd}nt|tjri}|j D]}tj |d}t|tj stjfcStj |d}t|tj stjfcS|j ||j <n/t|tj r|j }n tjfS tj|j |zfS#tt t"f$rtjfcYSwxYw)zInfer the result of '"string" % ...'. TODO: Instead of returning Uninferable we should rely on the call to '%' to see if the result is actually uninferable. c:g|]}tj|Sr5)rrA)rOir/s r7rz6_infer_old_style_string_formatting..s&RRR!w1!W==RRRr9c3JK|]}t|tjVdSrN)r?rrrOrs r7rQz5_infer_old_style_string_formatting..s.GGaz!U[))GGGGGGr9c3$K|] }|jV dSrN)rBrs r7rQz5_infer_old_style_string_formatting..s$@@q17@@@@@@r9Nr)r?rTuplerrr>alltuplerxrbrrArrBrrKeyError ValueError)r r r/inferred_positionalrHrrlrBs ` r7"_infer_old_style_string_formattingrs%%%#  uz ) )$& &RRRRuzRRR GG3FGGG G G @@,?@@@@@FFFF E5: & & #!#K , ,D$T!Wg66Cc5;// +(****&tAw88EeU[11 +(**** % F39   , E5; ' '# ""##HNV$;<<>> x ,### """"#s3F$F76F7r%opnodenodes.AugAssign | nodes.BinOprr method_namectj||}t||}|d}||j_t |t jr>t |jtr$|dkrtt|||S t| |}n$#t$r} t||| d} ~ wwxYwt |t jrtt |t jt jt jt jt*jfst||||||S)z8Invoke binary operation inference on the given instance.r%rur=N)r"rrrrr?rrrBriterrrr StopIterationrrrrListrr rinfer_binary_op) r rrr r/rrmethodrrPs r7_invoke_binop_inferencer&sQ"8[99G"7H55G QZF!'G 8U[))R x~s + +R #II6xPPQQQB W 5566 BBB&':::AB(D011 5; UZX    # #FBw I IIs#B77 CCCFnodes.AugAssignreverse9functools.partial[Generator[InferenceResult, None, None]]c ftj|}tjt||||||S)zCreate a new UnionType instance for binary or, e.g. int | str.N)r UnionType)r5r7s r7_bin_op_or_union_typer:s& /$ & &&&&&&r9c#K||fD]7}|}t|g|_d|_|V8dS)zGet contexts for binary operations. This will return two inference contexts, the first one for x.__op__(y), the other one for y.__rop__(x), where only the arguments are inversed. )rN)rrrr)r/r5r7arg new_contexts r7_get_binop_contextsr>s^t}mmoo "-C5"9"9"9  $  r9cV||kS)z$Check if type1 is the same as type2.)qname)type1type2s r7 _same_typerCs ;;==EKKMM ))r9 left_typeInferenceResult | None binary_opnode right_typereverse_contextc |j}t||rt|||||g}ntj||rt|||||g}nftj||r)t|||||dt|||||g}n(t|||||t|||||dg}t r|dkrt|tj tj fs!t|tj r}|j vt|tj tj fs!t|tj r6|j /|tjt"||g|S)aVGet the flow for binary operations. The rules are a bit messy: * if left and right have the same type, then only one method will be called, left.__op__(right) * if left and right are unrelated typewise, then first left.__op__(right) is tried and if this does not exist or returns NotImplemented, then right.__rop__(left) is tried. * if left is a subtype of right, then only left.__op__(right) is tried. * if left is a supertype of right, then right.__rop__(left) is first tried and then left.__op__(right) Tr(|)rrCr4r is_subtype is_supertyperr?r r9rrrrBrDr-r.r:) r5rDrFr7rGr/rHrrs r7_get_binop_flowrNs.  B)Z((  4E7CCD  Iz 2 2  4E7CCD  i 4 4  E="dOT R R R D-UG < <  D-UG < < E="dOT R R R  P #II teou~> ? ? $ ,,  " uu? @ @#%-- #  #  )*?uMMNOOO Nr9 aug_opnodec B|jd}|j}t||r't|||||t |||||g} nt j||r't|||||t |||||g} nt j||r;t|||||t |||||dt |||||g} n:t|||||t |||||t |||||dg} | S)aGet the flow for augmented binary operations. The rules are a bit messy: * if left and right have the same type, then left.__augop__(right) is first tried and then left.__op__(right). * if left and right are unrelated typewise, then left.__augop__(right) is tried, then left.__op__(right) is tried and then right.__rop__(left) is tried. * if left is a subtype of right, then left.__augop__(right) is tried and then left.__op__(right). * if left is a supertype of right, then left.__augop__(right) is tried, then right.__rop__(left) and then left.__op__(right) =TrJ)rstriprCr0r4rrLrM) r5rDrOr7rGr/rHbin_opaug_oprs r7 _get_aug_flowrUPsS0]  % %F ]F)Z(( D*feW = = D*feW = =   Iz 2 2 D*feW = = D*feW = =   i 4 4  D*feW = = E:vt_d S S S D*feW = =  D*feW = = D*feW = = E:vt_d S S S  Nr9 flow_factoryGetFlowFactoryGGenerator[InferenceResult | util.BadBinaryOperationMessage, None, None]c #Kt|||\}}tj|}tj|}||||||||}|D]} t| } t d| Drt jVdSttt| rgtd| D} | r$| t| krt jVdS| Ed{VdS#t$rYt$rYt$rt jVYdSwxYwt j||j|VdS)zInfer a binary operation between a left operand and a right operand. This is used by both normal binary operations and augmented binary operations, the only difference is the flow factory used. c3JK|]}t|tjVdSrNrrOrs r7rQz*_infer_binary_operation..s/RR:fd&:;;RRRRRRr9Nc38K|]}t|dVdS)rN)r r[s r7rQz*_infer_binary_operation..sD""+>v+F+F"""""""r9)r>r object_typerdrUrrrmapr sumlenrrrBadBinaryOperationMessager) r5r7rFr/rVrHrDrGrr%resultsnot_implementeds r7_infer_binary_operationrds 37D%HHG_#D))I$U++Jl iz7OG 6688nnGRR'RRRRR &&&&3*G4455 !"" '"""O ?c'll#B#B&&&&        FF/    H&    H   " " " " FFF *  (M4Dj Q QQQQQQsD D6 D6D65D6 nodes.BinOpc#K|j}|j}|p t}t|}t|}||}||}t j||D]n\}} td| |fDrtj VdS t|| ||tEd{VQ#t$rtj VYkwxYwdS)z!Binary operation inference logic.ruc3JK|]}t|tjVdSrNrrOrBs r7rQz_infer_binop../OO5z%!566OOOOOOr9N) r5r7rrrrnrrUrrrdrNr!) r.r/r5r7 lhs_context rhs_contextlhs_iterrhs_iterlhsrhss r7 _infer_binoprps, 9D JE +)++Gw''Kw''Kzz+z..H{{;{//H%h99 # #S OOS#JOOO O O " " " " FF #.sCwXX X X X X X X X X) # # #" " " " " " # # #s2CC,+C,c Dt|t|tjSrN)rrprrar6s r7 infer_binoprrs" $ lGT%C  r9c ||vSrNr5abs r7rws qAvr9c ||vSrNr5rts r7rwrws 1A:r9)z==z!=z>=inznot inz%dict[str, Callable[[Any, Any], bool]] COMPARE_OPSiszis notcNtj|SrN)ast literal_evalrk)r:s r7 _to_literalrs  DNN,, - --r9 left_iterIterable[nodes.NodeNG] right_iterbool | util.UninferableBasec(d}|tvr tjSt|}t j||D]\}}t |tjst |tjrtjcS t|t|}}n+#tttf$rtjcYcSwxYw |||}n#t$r }t|d}~wwxYw||}||krtjcS|J|S)aa If all possible combinations are either True or False, return that: >>> _do_compare([1, 2], '<=', [3, 4]) True >>> _do_compare([1, 2], '==', [3, 4]) False If any item is uninferable, or if some combinations are True and some are False, return Uninferable: >>> _do_compare([1, 3], '<=', [2, 4]) util.Uninferable N)UNINFERABLE_OPSrrr|rnrr?rr SyntaxErrorrrrr) rrrretvalop_funcr5r7rrs r7 _do_comparersYF _"oG (J??$$ e dD0 1 1 $Z 4'6 6  $# # # # $%d++[-?-?%DDZ8 $ $ $# # # # # # $ ,74''DD , , ," + , >FF t^^# # # #     Ms*B!!#C C  C C1$C,,C1 nodes.Compare9Generator[nodes.Const | util.UninferableBase, None, None]c+Kd}|j}|j}t||}|D]`\}}t||} t ||| }n#t $rt j}Yn wxYw|durn| }a|t jur|VdStj |VdS)z#Chained comparison inference logic.TruN) opsr5rdrrrrrrr) r.r/r1rr left_nodernr right_noderos r7_infer_comparer"s+/F (C I yw// 0 0C  J:##G#4455  b#..FF   %F EE     E !!! k&!!!!!!!s!A33B  B c#K|p t}|}|j|}|j|}t j||D]o\}}td||fDrtj VdS t||||tEd{VR#t$rtj VYlwxYwdS)z0Inference logic for augmented binary operations.ruc3JK|]}t|tjVdSrNrrhs r7rQz#_infer_augassign..Krir9N)r5r7rFr/rV)rrr infer_lhsrBrrnrrUrrrdrUr!)r.r/rkrlrmrnros r7_infer_augassignr@s9+)++G--//K{$$W$55Hz 44H%h99##S OOS#JOOO O O " " " " FF #."*         * # # #" " " " " " ###s$CCCc Dt|t|tjSrN)rrrrar6s r7infer_augassignr\s# $ )G  r9nodes.Argumentsc l||jt||tj||j|S)Nr=)rrr_arguments_infer_argnamer6s r7infer_argumentsrls<',4$8888  -dG4F P PPr9#nodes.AssignName | nodes.AssignAttrc t|jtjr|j|St ||}tj||S)zXInfer a AssignName/AssignAttr: need to inspect the RHS part of the assign node. ru) r?rTr AugAssignrrdassigned_stmtsr r)r.r/r1rs r7 infer_assignrxsa$+u//*{  ))) $$W$55 6 6E  eW - --r9nodes.EmptyNodec+K|stjVdS t|j|Ed{VdS#t $rtjVYdSwxYw)Nru)has_underlying_objectrrr#infer_ast_from_somethingobjectrr6s r7infer_empty_noders  % % ' '# #%''@@ WA          # # #" " " " " " " #s.AA43A4callci}||S|jD],}t|tjr |||j<'|||<-|j|jng}|D] }|||j< |SrN)rr?rr@rBr)rr/context_lookupr<rkeywords r7rrs?ANy** c5= ) ) *(/N39 % %")N3   $ 9t}}rH00(/w}%% r9 nodes.IfExpc+Kd}|p t}t|}t|} t|j|}t |tjsX| r"|j |Ed{Vn>|j |Ed{Vnd}n#ttf$rd}YnwxYw|rD|j |Ed{V|j |Ed{VdSdS)zSupport IfExp inference. If we can't infer the truthiness of the condition, we default to inferring both branches. Otherwise, we infer either branch depending on the condition. FruNT)rrrtestrrr?rrrbodyorelserr")r.r/r1 both_branchesrjrkrs r7 infer_ifexprsM +)++Gw''Kw''K !DIOOGMMOOO<<==$ 455 !   B9??;???????????;,,[,AAAAAAAAAA MM M * :9??;?777777777;$$[$99999999999::s:C##C98C9=Generator[Property | _FunctionDefT, None, InferenceErrorInfo]c+rK|jrtj|s|Vt||S|jd}|j|jvo(td|j|jD}t|jtj tj tj frd}t||j|j|s|jnd|j}|r |j|_|g|j|j|Vt||S)Nr=T)futurec3JK|]}t|tjVdSrN)r?r(r')rOvals r7rQz$infer_functiondef..sHQQ.1 3())QQQQQQr9)functionryrRrTrS)rrdoc_node)rr _is_propertyr$rTrrylocalsrUr?r TryExcept TryFinallyIfr(r'rRrSrWrr)r.r/r1 parent_frame!property_already_in_parent_locals prop_funcs r7infer_functiondefrs[ ?>%"4T":":> !tW====;$$D$11L(, \5H(H)SQQ5A5H5SQQQNN%$+1A58LMM1,0)   Y{"CMt{{? !I)';  BTYGGG OOO 4 9 9 99r9rN)r.r)r/r0r1r r2r3)r:r*r/r0r2r;)r.r*r/r0r1r r2rK)r.r[r/r0r2r\)rfrgrhrgr2rg)r:r[r/r0r2rg)r:r}r2r~)r.rr/r0r1r r2r)r.rr/r0r1r r2r)NT) r.rr/r0rrr1r r2r) r.rr/r0rrr1r r2r)r.rr/r0r1r r2r)r.rr/r0r1r r2r)r.rr/r0r1r r2r)r.rr/r0r1r r2r) r.r)rrr/r0rrr2r)r.rr/r0r2r)r.rr/r0r1r r2r)r2r)r r r r}r/rr2r )r r%rrrrr r%r/rrrr2r)F)r r%rr'rrr r%r/rr(rr2r))r r%rrrrr r%r/rr(rr2r))r5r6r7r6r2r)r5r%rDrErFrr7r%rGrEr/rrHrr2r-)r5r%rDrErOr'r7r%rGrEr/rrHrr2r-) r5r%r7r%rFrr/rrVrWr2rX)r.rer/r0r2rX)r.rer/r0r1r r2r)r:r}r2r )rrrrrrr2r)r.rr/r0r1r r2r)r.r'r/r0r2rX)r.r'r/r0r1r r2r)r.rr/r0r1r r2r)r.rr/r0r1r r2r)r.rr/r0r1r r2r)rrr/r0)r.rr/r0r1r r2r)r.r,r/r0r1r r2r)__doc__ __future__rrr-rnrtypingcollections.abcrrrrrr r r r astroidr rrrrrr astroid.constrastroid.contextrrrrastroid.exceptionsrrrrrrrr r!astroid.interpreterr"astroid.managerr#astroid.typingr$r%r&astroid.objectsr' lazy_importr(r) BaseContainerr*rr,rBinOprWr8Module_inferrLambdarSlicerEraise_if_nothing_inferredrZr#rSetrersrcrxrr path_wrapperName AssignNamerrCallrImportr ImportFromr Attribute AssignAttrrGlobalrrr SubscriptrBoolOprrrUnaryOpr rr&r0r4r:r>rCrNrUrdrpyes_if_nothing_inferredrreqneltlegtger|__annotations__rrrrComparerrr Argumentsrr EmptyNoderrIfExprr5r9r7rs  TSS""""""  CCCCCCCCCCCC??????????????RRRRRRRRRRRRRRRRRR$$$$$$                      .-----****** )(((((( $ 9 % % WT]]'+53FGGGu/@AAA ! eou{*+!F G "26  !   ?C0 %(,&%(# # ! :>     %%%%40 ,(,5555589J8JJ'' ( % 9=::::&%:0  % (,BBBB&%B*#  % (,&%B, (,:::::D>=JO,,BZA/RR % ;?    &% # fhh?C88888z>=JO,,AJ@QQ % ;?2:2:2:2:&%2:j$  (=A:+:+:+:+:+z % <@::::&%: . $ LLLL "#"#"#"#JJJJJP 6 6''''    **** 6666r0000f/R/R/R/Rf;?#####6 # :>$#(    + +  +  +  %% 6 6       ....++++^=A"""""6& ?C#####8 % >B&%$4 (  %>BQQQQ&%Q) % (, . . . .&% .'& % >B # # # #&% #*" %:>::::&%:D! =A:::::D-r9