TL i,ddlZddlZddlmZddlmZddlmZmZddl m Z ddl m Z ddl mZddlmZd Zd Z d Z dd Zd ZdZdZdZdZddZdZdZdZddZddZdZ dZ! ddZ" ddZ#y) N)python_bytes_to_unicode)dbg)KnownContentFileIOFolderIO) SubModuleName)load_module_from_path)ParserTreeFilter) convert_names)z.toxz.venvz .mypy_cachevenv __pycache__ic#K|D]M}||vrt|ts||jdk(s,t|j |Ed{Oy7w)Nmodule) isinstancerapi_type_resolve_namesgoto)definition_names avoid_namesnames _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/jedi/inference/references.pyrrs^ E ;  $ .J ==H $%diik3CD D D E Es.AAAAc&td|DS)Nc3TK|] }|j|n |j|f"ywN) tree_name.0ns r z _dictionarize...s, kk!q{{A6s&()dict)namess r _dictionarizer"-s  c  t||}t|D]:}|tt|g|j j dz}<|tt ||jz}t|D]m}|jdk(s/|j#|jjjdk(rB|tt|j|jz}ott|S)NF) only_stubsprefer_stub_to_compiledparamtrailer) _find_nameslistsetr get_root_contextis_stub_find_global_variablesvaluerrparenttype_add_names_in_same_contextparent_context string_namer)module_contextr found_namesrs r_find_defining_namesr74sni8K[! s= F002::<<$)    3-k9??KLLK[!^ ==G #t~~'=>>((--: s5d6I6I4K[K[\]] ^ ~k* ++r#c|j|}t|j}|j|tt |Sr) create_namer+raddr)r5rrr6s rr)r)Hs>  % %i 0Ddiik"KOOD ~k* ++r#c#K|jyd} t||}t|j|}|sy|Ed{t |d}|dj }R7"w)N)r3until_positionc|jSr) start_pos)xs rz,_add_names_in_same_context..^s akkr#)keyr) tree_noder r+getsortedr>)contextr4r<filter_r!ordereds rr2r2Psw N "") GKK ,- $9: --  sAA'A%#A'c#@K|D]}|j|j} |j}|j|D]?}||j |j}t ||j Ed{Ay7 #t$rYwxYwwr)rr,get_global_filterrCcreate_contextr2r4AttributeError)r! search_namerr5method global_namecs rr.r.bs R >> ! ..0 R#55F &x||K8 R !!"11+2G2GH5a9P9PQQQ R RR    s4#B BABB  B BBBBc|j}|j} d|_t||}d|_t ||g}|slt d|DD]W}||k7s |j |jj|jjvsG|j|Y|std|Dr|}n t|||}i} |D]}|j jj|gD]} t t!|| } tfd| DrEj#| | D].}| j|gD]} j#|  | |=0q| D]#} | j'| gj| %j)}|r$|Dcgc]}|j+|k(s|c}S|S#d|_wxYw#t$$rYwxYwcc}w)NFTc3<K|]}|jywr)r,)rds rrz"find_references..s?aQ'')?sc3:K|]}|jdk(yw)r'N)rrs rrz"find_references..sHqQZZ72Hsc3&K|]}|v ywr)rrfound_names_dcts rrz"find_references..sEI9/Es)inference_stater/flow_analysis_enabledr7r"r+rBprojectpath py__file__parentsappendany#get_module_contexts_containing_nameget_used_namesrCr)updateKeyError setdefaultvaluesr,)r5ronly_in_moduleinfrLr6module_contextsmpotential_modulesnon_matching_reference_maps name_leafnewdctrresultrrVs @rfind_referencesrors  ( (C//K)$)!*>9E $(!#K0O%&O ?;?? *AN"q{{'> ((ALLN,B,BB&&q) * HKHH+?     #%+Q'11@@BFF{TVW QI NI FGCEEE&&s+!$I:>>y"M4(..s347 B  QD/::4DKKCPQ QQ" # # %F!LaQ%7%7%9^%KLL MS%)!B$Ms)G1G'9G6G6 G$' G3 2G3 c |j}t|d}|j|syt |j |}t ||}|jry|jS#t$rYywxYw)Nreplace)errors) readFileNotFoundErrorrsearchrrZr is_compiled as_context)rWfile_ioregexcode new_file_iorhs r _check_fsr|sw||~ #4 :D << $W\\48Ko{;A}} <<> sA44 B?Bct}t}|jjD]}|r&|jds|jdsd|vr,|j ddj d}d|vrK|j d}|jtjj|j||}|j|j|f||fS)N#!*zutf-8ignore/) r+rs splitlines startswithdecoderstriplstripr:osrZjoin) folder_iorxignored_paths_absignored_paths_rellprs rgitignored_pathsrs \\^ & & ( :ALL&!,,t*<  HHWh ' . .s 3 !888C=D  ! !"'',,y~~t"D ED  ! !9>>4"8 9 : / //r#c|j}|Dchc]:}|j|dstjj||d<c}Scc}w)Nr)rZrrr)rrelative_paths curr_pathrs rexpand_relative_ignore_pathsrsFI3A `aYEYEYZ[\]Z^E_BGGLLAaD ) `` `s A%Ac#Kt|}t}|jD]\}}}|D]O}|j}|jdvr ||vrd|f|jdk(s7t ||\}} ||z}|| z}Qt ||} |Dcgc]6}|j|vr&|j| vr|jtvr|8c}|dd|D]}|df ycc}ww)N)z.pyz.pyiz .gitignore) r+walkrZsuffixrrr get_base_name_IGNORE_FOLDERS) r except_pathsexcept_paths_relativeroot_folder_io folder_iosfile_iosrxrZrrexcept_paths_relative_expandeds r%recurse_find_python_folders_and_filesrs"|$LE090@", H ;G<.s>D<8<< @T4Y M "<<}4!M "   T "!335I 6>sC CA7C 1/C c#K|Dcgc]}|j}}tt|jj|Ed{ycc}w7 wr)r[rrrYrZ)rWrgrhexcept_s r_find_project_modulesr sI'67!q||~7G7(/2I2I2N2N)OQXYYY8YsAA.A A Ac#K|D]}|jr|t|dkryt||}t||||Ed{y7w)z Search a name in the directories of modules. :param limit_reduction: Divides the limits on opening/parsing files by this factor. N)limit_reduction)rvlenrsearch_in_file_ios)rWrgrrr5file_io_iterators rr_r_sj*  % % '  4yA~ -_oN!/3CT2ACCCsA A A Ac#0Kt|z }t|z }d}d}tjdtj|z|rdndz} |D]E} |dz }t || | } | |dz }| ||k\rt d|y||k\s9t d|yyw)Nrz\brzHit limit of parsed files: %szHit limit of opened files: %s)_PARSED_FILE_LIMIT_OPENED_FILE_LIMITrecompileescaper|r) rWrrrcomplete parse_limit open_limit file_io_countparsed_file_countryrxrhs rrr,s$6K#o5JM JJuryy.#uM NE#  ow 6 =  " G K/3[A J & / <  s BBB)rU)F)r)rF)$rrparsor jedi.debugr jedi.file_iorrjedi.inference.namesrjedi.inference.importsrjedi.inference.filtersr !jedi.inference.gradual.conversionr rrrrr"r7r)r2r.ror|rrrrrrr_rrUr#rrs )5.83;I  E ,(,.$ R 3l 0&a "D 6*Z 9:C849r#