ó
    Ð]j+  ã                   ó*  • S SK r S SKrS SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  1 SkrS	rSS
 jrS rS rS rS rS rS r  S S jrS rS rS rS rSS jr\" \5      rS rS rS r S r!S r"\"" S 5      r#\"" S 5      r$\"" S 5      r%g)!é    N)Úliteral_eval)Úcleandoc©ÚWeakKeyDictionary)Útree)Úparser_cache)Úsplit_lines>   ÚatomÚexprÚtermÚtestÚpowerÚfactorÚfuncdefÚor_testÚand_exprÚand_testÚclassdefÚnot_testÚxor_exprÚ	atom_exprÚ
arith_exprÚ
comparisonÚ
shift_exprÚimport_fromÚimport_name)	ÚtryÚexceptÚfinallyÚelseÚifÚelifÚwithÚforÚwhilec                 ón  • / nU R                   nUS:X  aH  U R                  5       nUSL a1  U R                  R                   S:w  a  US:w  a  UR                  U 5        U$ US:X  a3  UR                  U 5        U R                   H  nU[        USS9-  nM     U$ US:X  a8  U R                  S	   S
:X  a#  U R                  S   n U S:w  a  U[        U 5      -  nU$  U R                  nU R                   [        ;   a  U(       d  UR                  U 5        U H  nU[        XQ5      -  nM     U$ ! [         a     U$ f = f)z
For static analysis.
ÚnameFÚparamÚ=Ú	expr_stmtT)Ú
last_addedÚ	decoratoréþÿÿÿÚ)éýÿÿÿÚ()ÚtypeÚget_next_leafÚparentÚappendÚchildrenÚget_executable_nodesÚ_EXECUTE_NODESÚAttributeError)Únoder+   ÚresultÚtypÚ	next_leafÚchildr5   s          ÚN/home/mande/repo/quber/.venv/lib/python3.13/site-packages/jedi/parser_utils.pyr6   r6      sH  € ð €FØ
�)‰)€CØ
ˆfƒ}Ø×&Ñ&Ó(ˆ	Ø˜Ò 4§;¡;×#3Ñ#3°wÓ#>À9ÐPSÓCSØ�M‰M˜$Ôð2 €Mð1 
�Ó	ð 	�‰�dÔØ—]”]ˆEØÔ*¨5¸TÑBÑBŠFñ #ð( €Mð% 
�Ó	à�=‰=˜Ñ Ó#Ø—=‘= Ñ$ˆDØ�s‹{ØÔ.¨tÓ4Ñ4�ð €Mð		BØ—}‘}ˆHð �y‰yœNÓ*¶:Ø—‘˜dÔ#ã!�ØÔ.¨uÓAÑA’ñ "ð €Møô ó 	Øð €Mð	ús   ÃD& Ä&
D4Ä3D4c              #   óä   #   • U v •  U R                   S   n UR                  S:X  a  UR                   S   v •  O&UR                  S:X  a  Uv •  OUR                  S:X  d  g UR                   S   nMY  7f)NéÿÿÿÿÚcomp_foré   Úsync_comp_forÚcomp_if©r5   r1   )rA   Úlasts     r>   Úget_sync_comp_forsrG   :   sk   é € Ø
‚NØ×Ñ˜RÑ €DØ
Ø�9‰9˜
Ó"Ø—-‘- Ñ"Ó"Ø�Y‰Y˜/Ó)Ø‹JØ—‘˜iÓ'ØØ�}‰}˜RÑ ˆñ ùs   ‚A.A0c                 ó:   • U R                   S   R                  S:H  $ )z’
Returns True if only one name is returned: ``for x in y``.
Returns False if the for loop is more complicated: ``for x, z in y``.

:returns: bool
rB   r'   rE   )Úfor_stmts    r>   Úfor_stmt_defines_one_namerJ   G   s    € ð ×Ñ˜QÑ×$Ñ$¨Ñ.Ð.ó    c                 ó  • UR                   nU R                   Us=:  a  U R                  ::  d  O  [        S5      eS n[        U R                  5       H6  u  pEX%R                   :  a  Us  $ UR                  5       nU[        ;   d  M4  UnM8     g )Nz!The node is not part of the flow.)Ú	start_posÚend_posÚ
ValueErrorÚ	enumerater5   Úget_first_leafÚ_FLOW_KEYWORDS)Ú	flow_noder9   rM   ÚkeywordÚir=   Ú
first_leafs          r>   Úget_flow_branch_keywordrW   Q   s{   € Ø—‘€IØ×Ñ )Õ@¨y×/@Ñ/@Õ@ÜÐ<Ó=Ð=à€GÜ˜i×0Ñ0Ö1‰ˆØ—‘Ó&ØŠNØ×)Ñ)Ó+ˆ
ØœÕ'Ø ŠGñ 2ð rK   c                 óf   • U R                  5       nUb  [        [        UR                  5      5      $ g)z2Returns a cleaned version of the docstring token. Ú )Úget_doc_noder   Úsafe_literal_evalÚvalue)Ú
scope_noder9   s     r>   Úclean_scope_docstringr^   `   s0   € à×"Ñ"Ó$€DØÑô
 Ô)¨$¯*©*Ó5Ó6Ð6ØrK   c                 óü   • U R                   S:X  al  U R                  n U R                  5       nUbM  UR                   S:X  a=  UR                  S   nUR                   S:X  a  [	        [        UR                  5      5      $ g)Nr*   Úsimple_stmtr   ÚstringrY   )r1   r3   Úget_next_siblingr5   r   r[   r\   )Ú	tree_nodeÚmaybe_strings     r>   Úfind_statement_documentationre   l   ss   € Ø‡~�~˜Ó$Ø×$Ñ$ˆ	Ø ×1Ñ1Ó3ˆØÑ#Ø× Ñ  MÓ1Ø+×4Ñ4°QÑ7�Ø×$Ñ$¨Ó0Ü#Ô$5°l×6HÑ6HÓ$IÓJÐJØrK   c                 ó^   • U S S R                  5       nUS   S:X  d  US;   a  g[        U 5      $ )Né   r   Úf)ÚfrÚrfrY   )Úlowerr   )r\   Ú	first_twos     r>   r[   r[   x   s7   € Ø�b�q�	—‘Ó!€IØ��|�sÓ˜i¨<Ó7ð ä˜ÓÐrK   c                 óâ  • Uc)  U R                   S:X  a  SnOU R                  R                  nU R                  5       nU(       a  USS nSSR	                  S U 5       5      R                  5       -   S-   n[        R                  " S	S
U5      nU R                  (       a%  U(       d  SU R                  R                  5       -   nOSnX&-   U-   nSR	                  [        R                  " X�5      5      $ )zÑ
Generate a string signature of a function.

:param width: Fold lines if a line is longer than this value.
:type width: int
:arg func_name: Override function name when given.
:type func_name: str

:rtype: str
NÚlambdefz<lambda>rB   r0   rY   c              3   ó@   #   • U  H  oR                  5       v •  M     g 7f©N)Úget_code)Ú.0r(   s     r>   Ú	<genexpr>Ú get_signature.<locals>.<genexpr>—   s   é € Ð;²F¨5—n‘n×&Ð&²Fùs   ‚r.   z\s+Ú z ->Ú
)r1   r'   r\   Ú
get_paramsÚjoinÚstripÚreÚsubÚ
annotationrq   ÚtextwrapÚwrap)	r   ÚwidthÚcall_stringÚomit_first_paramÚomit_return_annotationÚparamsÚpÚrtypeÚcodes	            r>   Úget_signaturer‡   ‚   sÍ   € ð ÑØ�<‰<˜9Ó$Ø$‰Kà!Ÿ,™,×,Ñ,ˆKØ×ÑÓ!€FÞØ˜˜�ˆØˆb�g‰gÑ;±FÓ;Ó;×AÑAÓCÑCÀcÑI€Aä
�Šˆv�s˜AÓ€AØ××Ö"8Ø˜×*Ñ*×3Ñ3Ó5Ñ5‰àˆØ‰?˜UÑ"€Dà�9‰9”X—]’] 4Ó/Ó0Ð0rK   c                 ó�   •  U R                   nU H  n[        X15        M     g! [         a    U =R                  U-  sl         gf = f)z
Move the `Node` start_pos.
N)r5   Úmover8   Úline)r9   Úline_offsetr5   Úcs       r>   r‰   r‰   £   sC   € ð!Ø—=‘=ˆó ˆAÜ�Ö ò øô ó !Ø�	Š	�[Ñ �	ð!ús   ‚# £AÁAc                 ó˜  •  U R                   S:X  a(  U R                  S   R                  5       R                  nO§U R                   S:X  a(  U R                  S   R                  5       R                  nOoU R                   S:X  a6  U R                  S   R                  5       R	                  5       R                  nO)U R                  5       R	                  5       R                  n SU;  a  gXR                  S5      S nS	U;   a  USUR                  S	5       nS
U;   a  USUR                  S
5       nU$ ! [         a     g[         a     gf = f)z`
returns (as string) any comment that appears on the same line,
after the node, including the #
rI   é   Ú	with_stmté   r   é   NÚ#Úrv   )	r1   r5   rQ   Úprefixr2   Úget_last_leafr8   rO   Úindex)r9   Ú
whitespaceÚcomments      r>   Úget_following_comment_same_liner™   °   s+  € ð
Ø�9‰9˜
Ó"ØŸ™ qÑ)×8Ñ8Ó:×AÑA‰JØ�Y‰Y˜+Ó%ØŸ™ qÑ)×8Ñ8Ó:×AÑA‰JØ�Y‰Y˜)Ó#àŸ™ qÑ)×8Ñ8Ó:×HÑHÓJ×QÑQ‰Jà×+Ñ+Ó-×;Ñ;Ó=×DÑD‰Jð �*ÓØØ×)Ñ)¨#Ó.Ð/Ð0€GØˆwƒØÐ.˜7Ÿ=™=¨Ó.Ð/ˆØˆwƒØÐ.˜7Ÿ=™=¨Ó.Ð/ˆØ€Nøô ó ÙÜó ñ ðús)   ‚7D1 º7D1 Á2AD1 Â8(D1 Ä1
E	Ä=	E	ÅE	c                 óh   • U R                   nUS:X  a  U R                  S   R                   S:g  $ US;   $ )NrA   rB   rC   )Ú
file_inputr   r   rn   rC   )r1   r5   )r9   Úts     r>   Úis_scoper�   Ï   s8   € Ø�	‰	€AØˆJƒà�}‰}˜QÑ×$Ñ$¨Ñ7Ð7àÐQÑQÐQrK   c                 ó0   ^ ^• [        5       mSUU 4S jjnU$ )Nc                 óš   >• U c  T" X5      $  TU    n X1   $ ! [          a
    0 =nTU '    Nf = f! [          a    T" X5      =oCU'   Us $ f = frp   )ÚKeyError)Úparso_cache_noder9   Úinclude_flowsÚ
for_moduler:   ÚcacheÚfuncs        €€r>   ÚwrapperÚ(_get_parent_scope_cache.<locals>.wrapperÛ   sz   ø€ ØÑ#Ù˜Ó,Ð,ð	6ØÐ/Ñ0ˆJð	ØÑ#Ð#øô	 ó 	6Ø35Ð5ˆJ˜Ð/Ó0ð	6ûô
 ó 	Ù(,¨TÓ(AÐAˆF Ñ%ØŠMð	ús   Ž ”/ ˜,«,¯A
Á	A
©Fr   )r¥   r¦   r¤   s   ` @r>   Ú_get_parent_scope_cacher©   Ø   s   ù€ ÜÓ€E÷ð ð €NrK   c                 óÊ  ^ • T R                   nUc  g [        U5      (       aÓ  UR                  S;   aÁ  UR                  R	                  S5      nUR                  U   R
                  T R
                  :¼  a  T R                   R                  S:X  a  T R                   R                  T :X  a   U$ T R                   R                  S:X  a   T R                   R                  S   T :X  a   U$ UR                   nMâ  U$ U(       aY  [        U[        R                  5      (       a:  UR                  S:X  a(  [        U 4S jUR                  5        5       5      (       d  U$ UR                   nGMR  )	z
Returns the underlying scope.
N)r   r   rn   Ú:r(   Útfpdefr   Úif_stmtc              3   óŠ   >#   • U  H8  nUR                   TR                   s=:*  =(       a    UR                  :  Os  v •  M:     g 7frp   )rM   rN   )rr   Únr9   s     €r>   rs   Ú#get_parent_scope.<locals>.<genexpr>  s4   øé € ð =Ú%; ð ŸK™K¨4¯>©>×EÓE¸A¿I¹I×EÑEÚ%;ùs   ƒA A)r3   r�   r1   r5   r–   rM   r'   Ú
isinstancer   ÚFlowÚanyÚget_test_nodes)r9   r¢   Úscoper–   s   `   r>   Úget_parent_scoper¶   ì   s*  ø€ ð �K‰K€EØ�}Øà
Ü�E�?‰?Ø�z‰zÐ?Ó?ØŸ™×,Ñ,¨SÓ1�Ø—>‘> %Ñ(×2Ñ2°d·n±nÓDØ—{‘{×'Ñ'¨7Ó2°t·{±{×7GÑ7GÈ4Ó7OØð ˆLð Ÿ™×)Ñ)¨XÓ5¸$¿+¹+×:NÑ:NÈqÑ:QÐUYÓ:YØð ˆLð !&§¡˜Ù ØˆLÞœz¨%´·±×;Ñ;ð —J‘J )Ó+Üô =Ø%*×%9Ñ%9Ô%;ó=÷ =ñ =à�à—‘ˆò+ rK   c                 ó,   • [        X5      R                  $ )z…
Basically access the cached code lines in parso. This is not the nicest way
to do this, but we avoid splitting all the lines again.
)Úget_parso_cache_nodeÚlines©ÚgrammarÚpaths     r>   Úget_cached_code_linesr½     s   € ô
   Ó.×4Ñ4Ð4rK   c                 ó.   • [         U R                     U   $ )zË
This is of course not public. But as long as I control parso, this
shouldn't be a problem. ~ Dave

The reason for this is mostly caching. This is obviously also a sign of a
broken caching architecture.
)r   Ú_hashedrº   s     r>   r¸   r¸     s   € ô ˜Ÿ™Ñ(¨Ñ.Ð.rK   c                 óê   • [        U R                  SS9SUS   U R                  -
  S-    nUS   nU R                  US   :X  a  X0R                  -  nU(       d  gUS   SU US'   SR	                  U5      $ )z+
Cuts of the value of the leaf at position
T)ÚkeependsNr   rB   rY   r@   )r	   r\   rŠ   Úcolumnrx   )ÚleafÚpositionr¹   rÂ   s       r>   Úcut_value_at_positionrÅ   "  s{   € ô ˜Ÿ
™
¨TÑ2Ð3O°H¸Q±KÀ$Ç)Á)Ñ4KÈaÑ4OÐP€EØ�a‰[€FØ‡y�y�H˜Q‘KÓØ—+‘+ÑˆÞØØ�b‘	˜'˜6Ð"€Eˆ"�IØ�7‰7�5‹>ÐrK   c                 óh  • U R                   S:X  aE  [        U R                  5      S:X  a+  U R                  S   S:X  a  [        U R                  S   5      $ gU R                   S:X  a?  U R                  nUS   S:X  a  g[        US   5      (       d  g[	        S	 USS
  5       5      $ U R                   S:H  $ )zH
Checks if a path looks like `name` or `name.foo.bar` and not `name()`.
r
   r�   r   r0   rB   Fr   Úawaitc              3   óD   #   • U  H  oR                   S    S:H  v •  M     g7f)r   Ú.N)r5   )rr   rŒ   s     r>   rs   Ú!expr_is_dotted.<locals>.<genexpr>?  s   é € Ð>²¨A—:‘:˜a‘= CÖ'²ùs   ‚ Nr'   )r1   Úlenr5   Úexpr_is_dottedÚall)r9   r5   s     r>   rÌ   rÌ   0  s¤   € ð ‡y�y�FÓÜˆt�}‰}Ó Ó" t§}¡}°QÑ'7¸3Ó'>Ü! $§-¡-°Ñ"2Ó3Ð3ØØ‡y�y�KÓØ—=‘=ˆØ�A‰;˜'Ó!ØÜ˜h q™k×*Ñ*ØäÑ>°¸!¸"±Ó>Ó>Ð>Ø�9‰9˜ÑÐrK   c                 ó   ^ • U 4S jnU$ )Nc                 óŒ   >• U R                  5        H/  nUR                  S   nT" UR                  5       5      (       d  M/    g   g)zÕ
This is a heuristic. It will not hold ALL the times, but it will be
correct pretty much for anyone that doesn't try to beat it.
staticmethod/classmethod are builtins and unless overwritten, this will
be correct.
rB   TF)Úget_decoratorsr5   rq   )Úfunction_noder,   Údotted_nameÚdecorator_checkers      €r>   r¦   Ú&_function_is_x_method.<locals>.wrapperD  sD   ø€ ð '×5Ñ5Ö7ˆIØ#×,Ñ,¨QÑ/ˆKÙ  ×!5Ñ!5Ó!7×8Ó8Ùñ 8ð rK   © )rÓ   r¦   s   ` r>   Ú_function_is_x_methodrÖ   C  s   ø€ õð €NrK   c                 ó   • U S:H  $ )NÚstaticmethodrÕ   ©Úms    r>   Ú<lambda>rÛ   S  s	   € ¸1ÀÒ;NrK   c                 ó   • U S:H  $ )NÚclassmethodrÕ   rÙ   s    r>   rÛ   rÛ   T  s	   € ¸!¸}Ò:LrK   c                 óT   • U S:H  =(       d    U S:H  =(       d    U R                  S5      $ )NÚpropertyÚcached_propertyz.setter)ÚendswithrÙ   s    r>   rÛ   rÛ   V  s,   € ˆa�:‰o÷ ØÐÑ÷à	�
‰
�9ÓðrK   r¨   )éH   NFF)&rz   r}   Úastr   Úinspectr   Úweakrefr   Úparso.pythonr   Úparso.cacher   Úparsor	   r7   rR   r6   rG   rJ   rW   r^   re   r[   r‡   r‰   r™   r�   r©   r¶   Úget_cached_parent_scoper½   r¸   rÅ   rÌ   rÖ   Úfunction_is_staticmethodÚfunction_is_classmethodÚfunction_is_propertyrÕ   rK   r>   Ú<module>rí      sÊ   ðÛ 	Û Ý Ý Ý %å Ý $Ý òB€ð
€ô
"òJ
!ò/òò	ò	òð 26ØAFô1òB
!òò>Ròô(ñ@ 2Ð2BÓCÐ ò5ò/òòò&ñ  1Ñ1NÓOÐ Ù/Ñ0LÓMÐ Ù,ñóÑ rK   