TL i(ddlmZddlmZddlmZddlmZddlm Z ddl m Z m Z m Z ddlmZddlmZd ZGd d eZd Zd ZdZy)) defaultdict) Parameter)debug)PushBackIterator)analysis)LazyKnownValue LazyTreeValueLazyUnknownValue)iterable) ParamNamect|trS|j}|jjdk(r |j}t j |j|||Sy)Nargument) isinstancer dataparenttyperaddcontext) error_name lazy_valuemessagenodes Z/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/jedi/inference/param.py_add_argument_issuer sP*m, ;;  z );;D||J.. D'JJ -c2eZdZdfd ZdZdZdZxZS)ExecutedParamNamecZt|||j|||_||_y)N) arguments)super__init__name _lazy_value _is_default)selffunction_valuer param_noder is_default __class__s rr!zExecutedParamName.__init__s+ IN%%rc6|jjSN)r#inferr%s rr,zExecutedParamName.infers%%''rcF|jry|jj}|jtj tj fvry|jdsytfd|D}tjd||d|S)NTF)execute_annotationc3jK|]*}jD]}|j|,ywr+)gather_annotation_classesis_sub_class_of).0c1c2 annotationss r z6ExecutedParamName.matches_signature..)sDI + E E GI((,I,Is03zparam compare %s: %s <=> %sBLUE)color) r$r, py__class__get_kindrVAR_POSITIONAL VAR_KEYWORDinfer_annotationanyrdbg)r%argument_valuesmatchesr6s @rmatches_signaturez#ExecutedParamName.matches_signatures   **,224 ==?y779N9NO O++u+E I /II  /?Kv GrcPd|jjd|jdS)N)r)__name__ string_namer-s r__repr__zExecutedParamName.__repr__0s!^^44d6F6FGGr)F)rG __module__ __qualname__r!r,rCrI __classcell__)r)s@rrrs& ($Hrrc fd}gg}i}|j|j}jD]}|||jj<t j tt}td}i} d} d} jD]}d} t|d\} }| d} || }| | vrgd} djd| d}jD]>}jtj|jd |j | @nt#|||| | < t|d\} }|  |j| |jj| rtC|tC| z D]}||}|r | r|j&r|j6r(jD]S}t;t=}jtj|jd |j | U|jED]5\} }djd| d}jtGd|| 7t |}|r|d\}}|||fS#t$$r ||| <Y`wxYw#t$$rYnwxYw|j&d k(rsg}|C|j||D]-\} }| r|j)| |fn|j|/t+j,|j.|}t1|}n|j&d k(rA|||t+j2|j.t5|}t1|}i}n||j6st9}| sjD]S}t;t=}jtj|jd |j | Unt?||j6}d} n|}|jt#|||| tA|t8r|d| |jj<)a Return a tuple of: - a list of `ExecutedParamName`s corresponding to the arguments of the function execution `function_value`, containing the inferred value of those arguments (whether explicit or default) - a list of the issues encountered while building that list For example, given: ``` def foo(a, b, c=None, d='d'): ... foo(42, c='c') ``` Then for the execution of `foo`, this will return a tuple containing: - a list with entries for each parameter a, b, c & d; the entries for a, c, & d will have their values (42, 'c' and 'd' respectively) included. - a list with a single entry about the lack of a value for `b` ctt}jrjt d||yjdt j d|y)Nztype-error-too-many-argumentsrznon-public warning: %s)_error_argument_countlenget_calling_nodesappendrrwarning)rmrfuncdefissues unpacked_vas r too_many_argsz:get_executed_param_names_and_issues..too_many_argsHs\ !'3{+; <  & & ( MM#3  MM$  MM2A 6rcgSr+r[rrz5get_executed_param_names_and_issues..gsBrF)NNT TypeError: z-() got multiple values for keyword argument 'z'.ztype-error-multiple-valuesrOztype-error-too-few-arguments)r(z'() got an unexpected keyword argument 'ztype-error-keyword-argumentr)$ tree_nodeget_default_param_context get_paramsr"valuelistunpackriterrnextrRrSrrrrrKeyError star_count push_backr FakeTupleinference_staterFakeDictdictdefaultr rPrQr rsetitemsr)r&rrY result_params param_dictdefault_param_contextparamvar_arg_iteratornon_matching_keys keys_used keys_onlyhad_multiple_value_errorr(keyr key_paramrUcontextualized_nodelazy_value_listseq result_argdctkrremaining_arguments first_keyrVrWrXs ` @@@r#get_executed_param_names_and_issuesr4s(7"FMJ&&G+DDF##%-', 5::##$-y''01K'[(9:#J/II$##%R<  -|< XoI H&sO )#/3,#LL#/A/8/J/J/L+ $LL)<)D)D)E)<)A)A1N&7& 9h&HIcN !1<@MC)o,   5::+;+;!< = ?R1 AqME%)A''5==+4+F+F+H'-gs;7GHAMM %8%@%@%C%8%=%=qJ -224  Z||S " -    /0 3A 6 :j! &  U 2)1!#& 2*      q  O#&&x0%55MC(22C?C#**84 5 $$^%C%C_UC',J    "#h'##N$B$BDIZD[\C',J " ==(!1!3J$3<3N3N3P / 5gs;?O PA"MM ( $7$?$?$B$7$<$<,- !" "//Demm!TJ!%J% . IujZ  *&67*7*;Iejj&& 's$J(J,J)(J), J87J8c t||dS)a| Return a list of `ExecutedParamName`s corresponding to the arguments of the function execution `function_value`, containing the inferred value of those arguments (whether explicit or default). Any issues building this list (for example required arguments which are missing in the invocation) are ignored. For example, given: ``` def foo(a, b, c=None, d='d'): ... foo(42, c='c') ``` Then for the execution of `foo`, this will return a list containing entries for each parameter a, b, c & d; the entries for a, c, & d will have their values (42, 'c' and 'd' respectively) included. r)r)r&rs rget_executed_param_namesrs$ /~y I! LLrc|j}td|D}|dk(rd}ndt||z z}d|jd|t|d|dS) Nc3RK|]}|js |jsd!yw)r^N)rprj)r3ps rr7z(_error_argument_count..sK!allAKs''rzexactly z from %s to r]z () takes z arguments (z given).)rcsumrQr")rV actual_countparamsdefault_argumentsbefores rrPrPs`    !FKvKKA#f+0A"AB||VS[, @ArN) collectionsrinspectrjedirjedi.inference.utilsrjedi.inferencerjedi.inference.lazy_valuerr r jedi.inference.valuer jedi.inference.namesr rrrrrPr[rrrsK#1#$$)*KH H>l!^M* Ar