ó
    Ð]j—’  ã                   óä  • S r SSKrSSKJr  SSKJrJr  SSKJrJ	r	J
r
JrJrJr  SSKJr  SSKJr  \" / SQ5      r\" S	S
/5      \-  r\" / SQ5      \-  r\" / SQ5      r\" SS/5      r " S S5      r " S S5      r " S S\\
5      r " S S\5      r " S S\\	5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S \5      r  " S! S"\5      r! " S# S$\5      r" " S% S&\5      r# " S' S(\#5      r$ " S) S*\#5      r% " S+ S,\5      r& " S- S.\5      r' " S/ S0\5      r( " S1 S25      r) " S3 S4\\)5      r* " S5 S6\\)5      r+ " S7 S8\\5      r, " S9 S:\,5      r- " S; S<\5      r. " S= S>\,5      r/ " S? S@\/5      r0SA r1 " SB SC\/5      r2 " SD SE\25      r3 " SF SG\5      r4 " SH SI\45      r5 " SJ SK\45      r6 " SL SM\45      r7 " SN SO\45      r8 " SP SQ\45      r9 " SR SS\5      r: " ST SU\:5      r; " SV SW\:5      r< " SX SY\5      r= " SZ S[\=5      r> " S\ S]\=5      r? " S^ S_\=5      r@ " S` Sa\5      rASb rB " Sc Sd\\5      rC " Se Sf\5      rD " Sg Sh\5      rE " Si Sj\5      rF\FrG " Sk Sl\5      rHg)ma  
This is the syntax tree for Python 3 syntaxes. The classes represent
syntax elements like functions and imports.

All of the nodes can be traced back to the `Python grammar file
<https://docs.python.org/3/reference/grammar.html>`_. If you want to know how
a tree is structured, just analyse that file (for each Python version it's a
bit different).

There's a lot of logic here that makes it easier for Jedi (and other libraries)
to deal with a Python syntax tree.

By using :py:meth:`parso.tree.NodeOrLeaf.get_code` on a module, you can get
back the 1-to-1 representation of the input given to the parser. This is
important if you want to refactor a parser tree.

>>> from parso import parse
>>> parser = parse('import os')
>>> module = parser.get_root_node()
>>> module
<Module: @1-1>

Any subclasses of :class:`Scope`, including :class:`Module` has an attribute
:attr:`iter_imports <Scope.iter_imports>`:

>>> list(module.iter_imports())
[<ImportName: import os@1,0>]

Changes to the Python Grammar
-----------------------------

A few things have changed when looking at Python grammar files:

- :class:`Param` does not exist in Python grammar files. It is essentially a
  part of a ``parameters`` node.  |parso| splits it up to make it easier to
  analyse parameters. However this just makes it easier to deal with the syntax
  tree, it doesn't actually change the valid syntax.
- A few nodes like `lambdef` and `lambdef_nocond` have been merged in the
  syntax tree to make it easier to do deal with them.

Parser Tree Classes
-------------------
é    N)ÚMapping)ÚTupleÚAny)ÚNodeÚBaseNodeÚLeafÚ	ErrorNodeÚ	ErrorLeafÚsearch_ancestor)Úsplit_prefix)Úsplit_lines)Úif_stmtÚ
while_stmtÚfor_stmtÚtry_stmtÚ	with_stmtÚ
async_stmtÚsuiter   Úsimple_stmt)r   r   Ú	decoratedÚasync_funcdef)	Ú	expr_stmtÚsync_comp_forr   r   Úimport_nameÚimport_fromÚparamÚdel_stmtÚnamedexpr_testr   r   c                   ó>   • \ rS rSr% Sr\\S'   S\S'   \\S'   S rSr	g)	ÚDocstringMixinéD   © Útypeú	list[Any]ÚchildrenÚparentc                 óà  • U R                   S:X  a  U R                  S   nO�U R                   S;   aK  U R                  U R                  R                  S5      S-      nUR                   S:X  a  UR                  S   nOBU R                  nUR                  R                  nUR                  U5      nU(       d  gX4S-
     nUR                   S:X  a  UR                  S   nUR                   S	:X  a  U$ g)
z>
Returns the string leaf of a docstring. e.g. ``r'''foo'''``.
Ú
file_inputr   ©ÚfuncdefÚclassdefÚ:é   r   Nr   Ústring)r#   r%   Úindexr&   )ÚselfÚnoder   Úcr/   s        ÚN/home/mande/repo/quber/.venv/lib/python3.13/site-packages/parso/python/tree.pyÚget_doc_nodeÚDocstringMixin.get_doc_nodeJ   sÏ   € ð �9‰9˜Ó$Ø—=‘= Ñ#‰DØ�Y‰YÐ1Ó1Ø—=‘= §¡×!4Ñ!4°SÓ!9¸AÑ!=Ñ>ˆDØ�y‰y˜GÓ#Ø—}‘} QÑ'�øàŸ+™+ˆKØ×"Ñ"×+Ñ+ˆAØ—G‘G˜KÓ(ˆEÞØØ˜Q‘Y‘<ˆDà�9‰9˜Ó%Ø—=‘= Ñ#ˆDØ�9‰9˜Ó ØˆKØó    N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú	__slots__ÚstrÚ__annotations__r   r4   Ú__static_attributes__r"   r6   r3   r    r    D   s   ‡ Ø€IØ
ƒIØÓØƒKõr6   r    c                   ó.   • \ rS rSr% SrSrS\S'   S rSrg)ÚPythonMixinéc   z!
Some Python specific utilities.
r"   r$   r%   c                 óþ   • U R                    Hm  n[        U[        5      (       a=  UR                  S:X  a+  UR                  Us=::  a  UR
                  ::  a   Us  $   MQ  MS  MU  UR                  U5      nUc  Mk  Us  $    g)zl
Given a (line, column) tuple, returns a :py:class:`Name` or ``None`` if
there is no name at that position.
ÚnameN)r%   Ú
isinstancer   r#   Ú	start_posÚend_posÚget_name_of_position)r0   Úpositionr2   Úresults       r3   rG   Ú PythonMixin.get_name_of_positionj   so   € ð
 —”ˆAÜ˜!œT×"Ñ"Ø—6‘6˜VÓ#¨¯©°xÕ(LÀ1Ç9Á9Ô(LØ’Hô )MÑ#ð ×/Ñ/°Ó9�ØÓ%Ø!’Mñ ð r6   N)	r7   r8   r9   r:   Ú__doc__r;   r=   rG   r>   r"   r6   r3   r@   r@   c   s   ‡ ñð €IØÓõr6   r@   c                   ó$   • \ rS rSrSrS rS rSrg)Ú
PythonLeaféz   r"   c                 ó4   • [        X R                  5       5      $ ©N)r   Úget_start_pos_of_prefix©r0   s    r3   Ú_split_prefixÚPythonLeaf._split_prefix}   s   € Ü˜D×">Ñ">Ó"@ÓAÐAr6   c                 ó
  • U R                  5       nUb0  UR                  S:X  a   UR                  S;   a  UR                  5       nUc2  [        U R                  5      nU R
                  [        U5      -
  S-   S4$ UR                  $ )zK
Basically calls :py:meth:`parso.tree.NodeOrLeaf.get_start_pos_of_prefix`.
Ú
error_leaf)ÚINDENTÚDEDENTÚERROR_DEDENTr-   r   )Úget_previous_leafr#   Ú
token_typer   ÚprefixÚlineÚlenrF   )r0   Úprevious_leafÚliness      r3   rQ   Ú"PythonLeaf.get_start_pos_of_prefix€   s   € ð ×.Ñ.Ó0ˆØÑ$¨×);Ñ);¸|Ó)KØ!×,Ñ,Ð0TÓTØ)×;Ñ;Ó=ˆMàÑ Ü §¡Ó,ˆEà—9‘9œs 5›zÑ)¨AÑ-¨qÐ0Ð0Ø×$Ñ$Ð$r6   N)r7   r8   r9   r:   r;   rS   rQ   r>   r"   r6   r3   rM   rM   z   s   † Ø€IòBõ%r6   rM   c                   ó>   • \ rS rSrSrSr\S\\\4   4S j5       r	Sr
g)Ú_LeafWithoutNewlinesé’   z&
Simply here to optimize performance.
r"   Úreturnc                 ó^   • U R                   U R                  [        U R                  5      -   4$ rP   )r]   Úcolumnr^   ÚvaluerR   s    r3   rF   Ú_LeafWithoutNewlines.end_pos˜   s"   € à�y‰y˜$Ÿ+™+¬¨D¯J©J«Ñ7Ð7Ð7r6   N)r7   r8   r9   r:   rK   r;   Úpropertyr   ÚintrF   r>   r"   r6   r3   rc   rc   ’   s/   † ñð €Iàð8˜˜s C˜x™ó 8ó ó8r6   rc   c                   ó   • \ rS rSrSrSrg)ÚPythonBaseNodeéž   r"   N©r7   r8   r9   r:   r;   r>   r"   r6   r3   rm   rm   ž   ó   † ØƒIr6   rm   c                   ó   • \ rS rSrSrSrg)Ú
PythonNodeé¢   r"   Nro   r"   r6   r3   rr   rr   ¢   rp   r6   rr   c                   ó   • \ rS rSrSrSrg)ÚPythonErrorNodeé¦   r"   Nro   r"   r6   r3   ru   ru   ¦   rp   r6   ru   c                   ó   • \ rS rSrSrSrg)ÚPythonErrorLeaféª   r"   Nro   r"   r6   r3   rx   rx   ª   rp   r6   rx   c                   ó"   • \ rS rSrSrSrS rSrg)Ú	EndMarkeré®   r"   Ú	endmarkerc                 ó€   • S[        U 5      R                  < S[        U R                  5      < SU R                  < S3$ )NÚ<z	: prefix=z	 end_pos=Ú>)r#   r7   Úreprr\   rF   rR   s    r3   Ú__repr__ÚEndMarker.__repr__²   s*   � ä�‹J×Ô¤ d§k¡kÖ!2°D·L´Lð
ð 	
r6   N)r7   r8   r9   r:   r;   r#   r‚   r>   r"   r6   r3   r{   r{   ®   s   † Ø€IØ€Dõ
r6   r{   c                   ó&   • \ rS rSrSrSrSrS rSrg)ÚNewlineé¸   z&Contains NEWLINE and ENDMARKER tokens.r"   Únewlinec                 ód   • S[        U 5      R                  < S[        U R                  5      < S3$ )Nr   ú: r€   )r#   r7   r�   rh   rR   s    r3   r‚   ÚNewline.__repr__½   s    � Ü! $›Z×0Ô0´$°t·z±zÖ2BÐCÐCr6   N)	r7   r8   r9   r:   rK   r;   r#   r‚   r>   r"   r6   r3   r…   r…   ¸   s   † Ù0Ø€IØ€DõDr6   r…   c                   ó:   • \ rS rSrSrSrSrS rS	S jrS
S jr	Sr
g)ÚNameéÁ   zU
A string. Sometimes it is important to know if the string belongs to a name
or not.
rC   r"   c           	      óŠ   • S[        U 5      R                  < SU R                  < SU R                  < SU R                  < S3	$ )Nr   r‰   Ú@Ú,r€   )r#   r7   rh   r]   rg   rR   s    r3   r‚   ÚName.__repr__É   s,   � Ü#'¨£:×#6Ô#6¸¿
¼
Ø#'§9¤9¨d¯k¬kð;ð 	;r6   c                 ó$   • U R                  US9SL$ )z,
Returns True if the name is being defined.
)Úinclude_setitemN)Úget_definition©r0   r“   s     r3   Úis_definitionÚName.is_definitionÍ   s   € ð ×"Ñ"°?Ð"ÐCÈ4ÐOÐOr6   c                 óŒ  • U R                   nUR                  nUS;   a  XR                  :X  a  U$ gUS:X  a!  U R                  5       S:X  a  UR                   $ gUbj  UR                  S:X  a  gUR                  [        ;   a4  XR                  U5      ;   a  U$ U(       a  UR                  [        ;   a  U$ gUR                   nUb  Mj  g)zÆ
Returns None if there's no definition for a name.

:param import_name_always: Specifies if an import name is always a
    definition. Normally foo in `from foo import bar` is not a
    definition.
r)   NÚexcept_clauseÚasr   )r&   r#   rC   Úget_previous_siblingÚ_GET_DEFINITION_TYPESÚget_defined_namesÚ_IMPORTS)r0   Úimport_name_alwaysr“   r1   Útype_s        r3   r”   ÚName.get_definitionÓ   s»   € ð �{‰{ˆØ—	‘	ˆàÐ+Ó+Ø—y‘yÓ Ø�Øà�OÓ#Ø×(Ñ(Ó*¨dÓ2Ø—{‘{Ð"ØàÑØ�y‰y˜GÓ#ØØ�y‰yÔ1Ó1Ø×1Ñ1°/ÓBÓBØ�KÞ%¨$¯)©)´xÓ*?Ø�KØØ—;‘;ˆDð Óð r6   N©F)FF)r7   r8   r9   r:   rK   r#   r;   r‚   r–   r”   r>   r"   r6   r3   rŒ   rŒ   Á   s#   † ñð €DØ€Iò;ôP÷r6   rŒ   c                   ó   • \ rS rSrSrSrg)ÚLiteraléõ   r"   Nro   r"   r6   r3   r¤   r¤   õ   rp   r6   r¤   c                   ó   • \ rS rSrSrSrSrg)ÚNumberéù   Únumberr"   N©r7   r8   r9   r:   r#   r;   r>   r"   r6   r3   r§   r§   ù   s   † Ø€DØƒIr6   r§   c                   ó2   • \ rS rSrSrSr\S 5       rS rSr	g)ÚStringéþ   r.   r"   c                 ób   • [         R                  " SU R                  5      R                  S5      $ )Nz\w*(?=[\'"])r   )ÚreÚmatchrh   ÚgrouprR   s    r3   Ústring_prefixÚString.string_prefix  s"   € ä�xŠx˜¨¯©Ó4×:Ñ:¸1Ó=Ð=r6   c                 ó¸   • [         R                  " SU R                  [         R                  S9nUR	                  S5      S [        UR	                  S5      5      *  $ )Nz('{3}|"{3}|'|")(.*)$)Úflagsé   r-   )r¯   Úsearchrh   ÚDOTALLr±   r^   )r0   r°   s     r3   Ú_get_payloadÚString._get_payload  sI   € Ü—	’	Ø'Ø�J‰JÜ—)‘)ñ
ˆð
 �{‰{˜1‹~Ð3¤ E§K¡K°£NÓ 3Ð3Ð4Ð4r6   N)
r7   r8   r9   r:   r#   r;   rj   r²   r¹   r>   r"   r6   r3   r¬   r¬   þ   s#   † Ø€DØ€Iàñ>ó ð>õ5r6   r¬   c                   ó    • \ rS rSrSrSrSrSrg)ÚFStringStringi  úl
f-strings contain f-string expressions and normal python strings. These are
the string parts of f-strings.
Úfstring_stringr"   N©r7   r8   r9   r:   rK   r#   r;   r>   r"   r6   r3   r¼   r¼     s   † ñð €DØƒIr6   r¼   c                   ó    • \ rS rSrSrSrSrSrg)ÚFStringStarti  r½   Úfstring_startr"   Nr¿   r"   r6   r3   rÁ   rÁ     s   † ñð €DØƒIr6   rÁ   c                   ó    • \ rS rSrSrSrSrSrg)Ú
FStringEndi!  r½   Úfstring_endr"   Nr¿   r"   r6   r3   rÄ   rÄ   !  s   † ñð €DØƒIr6   rÄ   c                   ó0   • \ rS rSr% Sr\\S'   S rS rSr	g)Ú_StringComparisonMixini*  r"   rh   c                 óP   • [        U[        5      (       a  U R                  U:H  $ XL $ )zM
Make comparisons with strings easy.
Improves the readability of the parser.
)rD   r<   rh   ©r0   Úothers     r3   Ú__eq__Ú_StringComparisonMixin.__eq__.  s(   € ô
 �eœS×!Ñ!Ø—:‘: Ñ&Ð&àˆ}Ðr6   c                 ó,   • [        U R                  5      $ rP   )Úhashrh   rR   s    r3   Ú__hash__Ú_StringComparisonMixin.__hash__8  ó   € Ü�D—J‘JÓÐr6   N)
r7   r8   r9   r:   r;   r   r=   rË   rÏ   r>   r"   r6   r3   rÇ   rÇ   *  s   ‡ Ø€IØƒJòõ r6   rÇ   c                   ó   • \ rS rSrSrSrSrg)ÚOperatori<  Úoperatorr"   Nrª   r"   r6   r3   rÓ   rÓ   <  s   † Ø€DØƒIr6   rÓ   c                   ó   • \ rS rSrSrSrSrg)ÚKeywordiA  Úkeywordr"   Nrª   r"   r6   r3   rÖ   rÖ   A  s   † Ø€DØƒIr6   rÖ   c                   óT   ^ • \ rS rSrSrSrU 4S jrS rS rS r	S r
S	 rS
 rSrU =r$ )ÚScopeiF  zƒ
Super class for the parser tree, which represents the state of a python
text file.
A Scope is either a function, class or lambda.
r"   c                 ó$   >• [         TU ]  U5        g rP   ©ÚsuperÚ__init__©r0   r%   Ú	__class__s     €r3   rÝ   ÚScope.__init__N  ó   ø€ Ü‰Ñ˜Õ"r6   c                 ó$   • U R                  S5      $ )z)
Returns a generator of `funcdef` nodes.
r*   ©Ú_search_in_scoperR   s    r3   Úiter_funcdefsÚScope.iter_funcdefsQ  s   € ð ×$Ñ$ YÓ/Ð/r6   c                 ó$   • U R                  S5      $ )z*
Returns a generator of `classdef` nodes.
r+   rã   rR   s    r3   Úiter_classdefsÚScope.iter_classdefsW  s   € ð ×$Ñ$ ZÓ0Ð0r6   c                 ó&   • U R                  SS5      $ )z?
Returns a generator of `import_name` and `import_from` nodes.
r   r   rã   rR   s    r3   Úiter_importsÚScope.iter_imports]  s   € ð ×$Ñ$ ]°MÓBÐBr6   c                 ó8   ^^• UU4S jmT" U R                   5      $ )Nc              3   ó¬   >#   • U  HG  nUR                   T;   a  Uv •  UR                   [        ;   d  M-  T" UR                  5       S h  v•N   MI     g  N	7frP   )r#   Ú_FUNC_CONTAINERSr%   )r%   ÚelementÚnamesÚscans     €€r3   rò   Ú$Scope._search_in_scope.<locals>.scand  sG   øé € Û#�Ø—<‘< 5Ó(Ø!’MØ—<‘<Ô#3Õ3Ù# G×$4Ñ$4Ó5×5Ò5ò	 $ñ 6ùs   ƒ,A³AÁAÁ	
A©r%   )r0   rñ   rò   s    `@r3   rä   ÚScope._search_in_scopec  s   ù€ ö	6ñ �D—M‘MÓ"Ð"r6   c                 ó    • U R                   S   $ )z4
Returns the part that is executed by the function.
éÿÿÿÿrô   rR   s    r3   Ú	get_suiteÚScope.get_suitem  s   € ð �}‰}˜RÑ Ð r6   c           	      óÔ   •  U R                   R                  nS[        U 5      R                  < SU< SU R
                  S   < SU R                  S   < S3	$ ! [         a    Sn NNf = f)NÚ r   r‰   r�   r   Ú-r€   )rC   rh   ÚAttributeErrorr#   r7   rE   rF   )r0   rC   s     r3   r‚   ÚScope.__repr__s  s^   € ð	Ø—9‘9—?‘?ˆDøô $(¨£:×#6Ô#6»Ø#'§>¡>°!Ô#4°d·l±lÀ1´oðGð 	Gøô ó 	ØŠDð	ús   ‚A ÁA'Á&A')r7   r8   r9   r:   rK   r;   rÝ   rå   rè   rë   rä   rø   r‚   r>   Ú__classcell__©rß   s   @r3   rÙ   rÙ   F  s:   ø† ñð
 €Iõ#ò0ò1òCò#ò!÷Gð Gr6   rÙ   c                   ó@   ^ • \ rS rSrSrSrSrU 4S jrS rS r	Sr
U =r$ )ÚModulei}  zƒ
The top scope, which is always a module.
Depending on the underlying parser this may be a full module or just a part
of a module.
)Ú_used_namesr(   c                 ó2   >• [         TU ]  U5        S U l        g rP   )rÜ   rÝ   r  rÞ   s     €r3   rÝ   ÚModule.__init__†  s   ø€ Ü‰Ñ˜Ô"ØˆÕr6   c              #   ó6  #   • U R                  5        H|  nUR                  S:X  d  M  UR                  S:X  d  M'  UR                  5        HA  nU Vs/ s H  o3R                  PM     nn[        U5      S:X  d  M/  US   S:X  d  M:  US   v •  MC     M~     gs  snf 7f)z=
:return: A list of future import names.
:rtype: list of str
r   r   r¶   Ú
__future__r-   N)rë   r#   ÚlevelÚ	get_pathsrh   r^   )r0   ÚimpÚpathrC   rñ   s        r3   Ú_iter_future_import_namesÚ Module._iter_future_import_namesŠ  sz   é € ð ×$Ñ$Ö&ˆCØ�x‰x˜=Õ(¨S¯Y©Y¸!­^ØŸM™MžO�DÙ48Ó9²D¨DŸZœZ±D�EÐ9Ü˜5“z Q•¨5°©8°|Õ+CØ# A™hœó ,ò 'ùò :ùs'   ‚"B¨BºBÁBÁ&BÁ9BÂBc                 óz   ^^• U R                   c!  0 mUU4S jmT" U 5        [        T5      U l         U R                   $ )zx
Returns all the :class:`Name` leafs that exist in this module. This
includes both definitions and references of names.
c                 óà   >•  U R                   nU H  nT" U5        M     g ! [         aB    U R                  S:X  a/  TR                  U R                  / 5      nUR                  U 5         g  g f = f)NrC   )r%   rý   r#   Ú
setdefaultrh   Úappend)r1   r%   ÚchildÚarrÚdctÚrecurses       €€r3   r  Ú&Module.get_used_names.<locals>.recurse£  sf   ø€ ð'Ø#Ÿ}™}�Hó "*˜Ù žò "*øô &ó )Ø—y‘y FÓ*Ø!Ÿn™n¨T¯Z©Z¸Ó<˜ØŸ
™
 4Ö(ñ +ð)ús   ƒ! ¡AA-Á,A-)r  ÚUsedNamesMapping)r0   r  r  s    @@r3   Úget_used_namesÚModule.get_used_namesš  s=   ù€ ð
 ×ÑÑ#àˆCö	'ñ �DŒMÜ/°Ó4ˆDÔØ×ÑÐr6   )r7   r8   r9   r:   rK   r;   r#   rÝ   r  r  r>   rÿ   r   s   @r3   r  r  }  s(   ø† ñð
 !€IØ€Dõ ò'÷  ð  r6   r  c                   ó   • \ rS rSrSrSrSrg)Ú	Decoratori³  Ú	decoratorr"   Nrª   r"   r6   r3   r  r  ³  s   † Ø€DØƒIr6   r  c                   ó.   • \ rS rSrSr\S 5       rS rSrg)ÚClassOrFunci¸  r"   c                 ó    • U R                   S   $ )zB
Returns the `Name` leaf that defines the function or class name.
r-   rô   rR   s    r3   rC   ÚClassOrFunc.name»  s   € ð
 �}‰}˜QÑÐr6   c                 ó   • U R                   nUR                  S:X  a  UR                   nUR                  S:X  aE  UR                  S   R                  S:X  a  UR                  S   R                  $ UR                  SS $ / $ )z$
:rtype: list of :class:`Decorator`
r   r   r   Ú
decoratorsNr-   )r&   r#   r%   )r0   r   s     r3   Úget_decoratorsÚClassOrFunc.get_decoratorsÂ  sx   € ð —K‘Kˆ	Ø�>‰>˜_Ó,Ø!×(Ñ(ˆIà�>‰>˜[Ó(Ø×!Ñ! !Ñ$×)Ñ)¨\Ó9Ø ×)Ñ)¨!Ñ,×5Ñ5Ð5à ×)Ñ)¨"¨1Ð-Ð-àˆIr6   N)	r7   r8   r9   r:   r;   rj   rC   r#  r>   r"   r6   r3   r  r  ¸  s   † Ø€Iàñ ó ð õr6   r  c                   ó:   ^ • \ rS rSrSrSrSrU 4S jrS rSr	U =r
$ )ÚClassiÓ  z6
Used to store the parsed contents of a python class.
r+   r"   c                 ó$   >• [         TU ]  U5        g rP   rÛ   rÞ   s     €r3   rÝ   ÚClass.__init__Ú  rá   r6   c                 óˆ   • [        U R                  5       H)  u  pUS:X  d  M  U R                  US-      nUS:X  a    gUs  $    g)zg
Returns the `arglist` node that defines the super classes. It returns
None if there are no arguments.
Ú(r-   Ú)N©Ú	enumerater%   )r0   Úir  Ú
next_childs       r3   Úget_super_arglistÚClass.get_super_arglistÝ  sH   € ô
 " $§-¡-Ö0‰HˆAØ˜�|Ø!Ÿ]™]¨1¨q©5Ñ1�
Ø Ó$ÙØ!Ò!ñ 1ð r6   )r7   r8   r9   r:   rK   r#   r;   rÝ   r0  r>   rÿ   r   s   @r3   r&  r&  Ó  s#   ø† ñð €DØ€Iõ#÷ð r6   r&  c                 óâ  •  US   nUR                  S;   a  [        U/U 5      /$ US:X  a  U/$ UR                  S:X  a  U/nOUR                  n/ nSn[	        US/-   S5       Hw  u  pgUb  US:X  d  M  X5U nU(       d  M  US   S:X  a  [        U5      S:X  d  US   S:X  d	  US   S:X  a  U H	  n	X	l        M     XH-  nOUR                  [        X€5      5        UnMy     U$ ! [          a    / s $ f = f)	aÔ  
`argslist_list` is a list that can contain an argslist as a first item, but
most not. It's basically the items between the parameter brackets (which is
at most one item).
This function modifies the parser structure. It generates `Param` objects
from the normal ast. Those param objects do not exist in a normal ast, but
make the evaluation of the ast tree so much easier.
You could also say that this function replaces the argslist node with a
list of Param objects.
r   )rC   ÚfpdefÚ*ÚtfpdefNr-   r�   Ú/)Ú
IndexErrorr#   ÚParamr%   r-  r^   r&   r  )
r&   Úargslist_listÚfirstr%   Únew_childrenÚstartÚendr  Úparam_childrenÚps
             r3   Ú_create_paramsr@  ë  s  € ðØ˜aÑ ˆð ‡z�zÐ&Ó&Ü�u�g˜vÓ&Ð'Ð'Ø	�#‹Øˆwˆà�:‰:˜Ó!Ø�w‰Hà—~‘~ˆHØˆØˆä# H°¨vÑ$5°qÖ9‰JˆCØ‰} ¨¥Ø!)°Ð!4�ß!�>Ø% aÑ(¨CÓ/Ü!$ ^Ó!4¸Ó!9Ø$2°1Ñ$5¸Ó$<Ø-¨aÑ0°CÓ7Û!/˜AØ'-žHñ "0à$Ñ6™à$×+Ñ+¬E°.Ó,IÔJØ’Eñ :ð Ðøô; ó ØŠ	ðús   ‚C ÃC.Ã-C.c                   ó~   ^ • \ rS rSrSrSrSrU 4S jrS rS r	S r
\S	 5       rS
 rS rS rS r\S 5       rSrU =r$ )ÚFunctioni  aF  
Used to store the parsed contents of a python function.

Children::

    0. <Keyword: def>
    1. <Name>
    2. parameter list (including open-paren and close-paren <Operator>s)
    3. or 5. <Operator: :>
    4. or 6. Node() representing function body
    3. -> (if annotation is also present)
    4. annotation (if present)
r*   r"   c                 óÂ   >• [         TU ]  U5        U R                  5       nUR                  SS n[	        S U 5       5      (       d  [        X#5      UR                  SS& g g )Nr-   r÷   c              3   óB   #   • U  H  n[        U[        5      v •  M     g 7frP   ©rD   r8  ©Ú.0r  s     r3   Ú	<genexpr>Ú$Function.__init__.<locals>.<genexpr>-  ó   é € ÐMÒ9L°”:˜e¤U×+Ð+Ò9Lùó   ‚)rÜ   rÝ   Ú_find_parametersr%   Úanyr@  )r0   r%   Ú
parametersÚparameters_childrenrß   s       €r3   rÝ   ÚFunction.__init__)  sc   ø€ Ü‰Ñ˜Ô"Ø×*Ñ*Ó,ˆ
Ø(×1Ñ1°!°BÐ7ÐÜÑMÑ9LÓM×MÑMÜ(6Øó)ˆJ×Ñ  "Ñ%ð Nr6   c                 óf   • U R                    H  nUR                  S:X  d  M  Us  $    [        S5      e)NrN  z(A function should always have parameters)r%   r#   Ú	Exception)r0   r  s     r3   rL  ÚFunction._find_parameters2  s/   € Ø—]”]ˆEØ�z‰z˜\Õ)Ø’ñ #ô ÐBÓCÐCr6   c                 ó6   • U R                  5       R                  $ rP   )rL  r%   rR   s    r3   Ú_get_param_nodesÚFunction._get_param_nodes8  s   € Ø×$Ñ$Ó&×/Ñ/Ð/r6   c                 óp   • U R                  5        Vs/ s H  oR                  S:X  d  M  UPM     sn$ s  snf )z
Returns a list of `Param()`.
r   )rU  r#   )r0   r?  s     r3   Ú
get_paramsÚFunction.get_params;  s0   € ð  ×0Ñ0Ô2ÓHÒ2�a·f±fÀÑ6G—Ñ2ÑHÐHùÒHs   “3ª3c                 ó    • U R                   S   $ ©Nr-   rô   rR   s    r3   rC   ÚFunction.nameA  ó   € à�}‰}˜QÑÐr6   c                 ó4   ^• U4S jmT" U R                   5      $ )z&
Returns a generator of `yield_expr`.
c              3   ó(  >#   • U  H2  nUR                   S;   a  M   UR                  nT" U5       S h  v•N   M4     g  N	! [         aF    UR                  S:X  a2  UR                  R                   S:X  a  UR                  v •   M~  Uv •   M…   Mˆ  f = f7f)N)r+   r*   ÚlambdefÚyieldÚ
yield_expr)r#   r%   rý   rh   r&   )r%   rð   Únested_childrenrò   s      €r3   rò   Ú'Function.iter_yield_exprs.<locals>.scanI  s‡   øé € Û#�Ø—<‘<Ð#EÓEÙð	5Ø&-×&6Ñ&6�Oñ  $ OÓ4×4Ò4ò $ñ 5øô &ó *Ø—}‘}¨Ó/Ø"Ÿ>™>×.Ñ.°,Ó>Ø")§.¡.Õ0à")�Mò	 0ð*üs;   ƒBœ?¨B³=´
B¿ABÂBÂBÂBÂBÂBrô   ©r0   rò   s    @r3   Úiter_yield_exprsÚFunction.iter_yield_exprsE  s   ø€ õ	5ñ  �D—M‘MÓ"Ð"r6   c                 ó4   ^• U4S jmT" U R                   5      $ )z'
Returns a generator of `return_stmt`.
c              3   óì   >#   • U  Hg  nUR                   S:X  d   UR                   S:X  a  UR                  S:X  a  Uv •  UR                   [        ;   d  MM  T" UR                  5       S h  v•N   Mi     g  N	7f)NÚreturn_stmtr×   re   ©r#   rh   Ú_RETURN_STMT_CONTAINERSr%   ©r%   rð   rò   s     €r3   rò   Ú(Function.iter_return_stmts.<locals>.scan_  s^   øé € Û#�Ø—<‘< =Ó0Ø"Ÿ<™<¨9Ó4¸¿¹È(Ó9RØ!’MØ—<‘<Ô#:Õ:Ù# G×$4Ñ$4Ó5×5Ò5ò $ñ
 6ùó   ƒAA4ÁA4Á(A2Á)
A4rô   re  s    @r3   Úiter_return_stmtsÚFunction.iter_return_stmts[  ó   ø€ õ	6ñ �D—M‘MÓ"Ð"r6   c                 ó4   ^• U4S jmT" U R                   5      $ )zY
Returns a generator of `raise_stmt`. Includes raise statements inside try-except blocks
c              3   óì   >#   • U  Hg  nUR                   S:X  d   UR                   S:X  a  UR                  S:X  a  Uv •  UR                   [        ;   d  MM  T" UR                  5       S h  v•N   Mi     g  N	7f)NÚ
raise_stmtr×   Úraiserk  rm  s     €r3   rò   Ú'Function.iter_raise_stmts.<locals>.scanm  s^   øé € Û#�Ø—<‘< <Ó/Ø"Ÿ<™<¨9Ó4¸¿¹È'Ó9QØ!’MØ—<‘<Ô#:Õ:Ù# G×$4Ñ$4Ó5×5Ò5ò $ñ
 6ùro  rô   re  s    @r3   Úiter_raise_stmtsÚFunction.iter_raise_stmtsi  rr  r6   c                 ó:   • [        U R                  5       S5      SL$ )z;
:return bool: Checks if a function is a generator or not.
N)Únextrf  rR   s    r3   Úis_generatorÚFunction.is_generatorw  s   € ô �D×)Ñ)Ó+¨TÓ2¸$Ð>Ð>r6   c                 ót   • [        U R                  5       H  u  pUS:X  d  M  U R                  US-      s  $    g)zG
Returns the test node after `->` or `None` if there is no annotation.
z->r-   Nr,  )r0   r.  r  s      r3   Ú
annotationÚFunction.annotation}  s8   € ô
 " $§-¡-Ö0‰HˆAØ˜�}Ø—}‘} Q¨¡UÑ+Ò+ñ 1ð r6   )r7   r8   r9   r:   rK   r#   r;   rÝ   rL  rU  rX  rj   rC   rf  rp  rx  r|  r  r>   rÿ   r   s   @r3   rB  rB    sf   ø† ñð €DØ€IõòDò0òIð ñ ó ð ò#ò,#ò#ò?ð ñó ör6   rB  c                   ó`   ^ • \ rS rSrSrSrSrU 4S jr\S 5       r	S r
\S 5       rS	 rSrU =r$ )
ÚLambdaiˆ  zÍ
Lambdas are basically trimmed functions, so give it the same interface.

Children::

     0. <Keyword: lambda>
     *. <Param x> for each argument x
    -2. <Operator: :>
    -1. Node() representing body
r`  r"   c                 óª   >• [         [        U ]  U5        U R                  SS n[	        S U 5       5      (       d  [        X5      U R                  SS& g g )Nr-   éþÿÿÿc              3   óB   #   • U  H  n[        U[        5      v •  M     g 7frP   rE  rF  s     r3   rH  Ú"Lambda.__init__.<locals>.<genexpr>�  rJ  rK  )rÜ   rB  rÝ   r%   rM  r@  )r0   r%   rO  rß   s      €r3   rÝ   ÚLambda.__init__–  sR   ø€ äŒh˜Ñ& xÔ0à"Ÿm™m¨A¨bÐ1Ðô ÑMÑ9LÓM×MÑMÜ"0°Ó"KˆD�M‰M˜!˜BÑð Nr6   c                 ó   • [        S5      e)z>
Raises an AttributeError. Lambdas don't have a defined name.
zlambda is not named.)rý   rR   s    r3   rC   ÚLambda.name   s   € ô
 Ð3Ó4Ð4r6   c                 ó    • U R                   SS $ )Nr-   r„  rô   rR   s    r3   rU  ÚLambda._get_param_nodes§  s   € Ø�}‰}˜Q˜rÐ"Ð"r6   c                 ó   • g)z1
Returns `None`, lambdas don't have annotations.
Nr"   rR   s    r3   r  ÚLambda.annotationª  s   € ð
 r6   c                 óT   • SU R                   R                  < SU R                  < S3$ )Nr   r�   r€   )rß   r7   rE   rR   s    r3   r‚   ÚLambda.__repr__±  s   � Ø ŸN™N×3Ô3°T·^´^ÐDÐDr6   )r7   r8   r9   r:   rK   r#   r;   rÝ   rj   rC   rU  r  r‚   r>   rÿ   r   s   @r3   r‚  r‚  ˆ  sS   ø† ñ	ð €DØ€IõLð ñ5ó ð5ò#ð ñó ð÷Eð Er6   r‚  c                   ó   • \ rS rSrSrSrg)ÚFlowiµ  r"   Nro   r"   r6   r3   r‘  r‘  µ  rp   r6   r‘  c                   ó.   • \ rS rSrSrSrS rS rS rSr	g)ÚIfStmti¹  r   r"   c              #   ó€   #   • [        U R                  5       H!  u  pUS;   d  M  U R                  US-      v •  M#     g7f)zp
E.g. returns all the `test` nodes that are named as x, below:

    if x:
        pass
    elif x:
        pass
)ÚelifÚifr-   Nr,  )r0   r.  r2   s      r3   Úget_test_nodesÚIfStmt.get_test_nodes½  s7   é € ô ˜dŸm™mÖ,‰DˆAØ�NÕ"Ø—m‘m A¨¡EÑ*Ô*ò -ùs   ‚>¥>c                 ó¸   • UR                   n[        [        U R                  5       5      5       H(  nUR                   U:  d  M  X#R                  :  a    gUs  $    g)z½
Searches for the branch in which the node is and returns the
corresponding test node (see function above). However if the node is in
the test node itself and not in the suite return None.
N)rE   ÚreversedÚlistr—  rF   )r0   r1   rE   Ú
check_nodes       r3   Úget_corresponding_test_nodeÚ"IfStmt.get_corresponding_test_nodeÊ  sP   € ð —N‘Nˆ	Ü"¤4¨×(;Ñ(;Ó(=Ó#>Ö?ˆJØ×#Ñ# iÕ/Ø×1Ñ1Ó1Ùð &Ò%ò @r6   c                 ór   • U R                    H'  nUS:X  d  M  UR                  UR                  :”  d  M'    g   g)z+
Checks if a node is defined after `else`.
ÚelseTF)r%   rE   )r0   r1   r2   s      r3   Úis_node_after_elseÚIfStmt.is_node_after_elseÚ  s1   € ð —”ˆAØ�F�{Ø—>‘> A§K¡KÕ/Ùñ ð
 r6   N)
r7   r8   r9   r:   r#   r;   r—  r�  r¡  r>   r"   r6   r3   r“  r“  ¹  s   † Ø€DØ€Iò+ò&õ 	r6   r“  c                   ó   • \ rS rSrSrSrSrg)Ú	WhileStmtiæ  r   r"   Nrª   r"   r6   r3   r¤  r¤  æ  ó   † Ø€DØƒIr6   r¤  c                   ó,   • \ rS rSrSrSrS rSS jrSrg)ÚForStmtië  r   r"   c                 ó    • U R                   S   $ )z5
Returns the input node ``y`` from: ``for x in y:``.
é   rô   rR   s    r3   Úget_testlistÚForStmt.get_testlistï  s   € ð �}‰}˜QÑÐr6   c                 ó4   • [        U R                  S   U5      $ r[  ©Ú_defined_namesr%   r•   s     r3   r�   ÚForStmt.get_defined_namesõ  ó   € Ü˜dŸm™m¨AÑ.°Ó@Ð@r6   Nr¢   )	r7   r8   r9   r:   r#   r;   rª  r�   r>   r"   r6   r3   r§  r§  ë  s   † Ø€DØ€Iò ÷Ar6   r§  c                   ó"   • \ rS rSrSrSrS rSrg)ÚTryStmtiù  r   r"   c              #   ó�   #   • U R                    H2  nUR                  S:X  a  UR                   S   v •  M&  US:X  d  M.  Sv •  M4     g7f)z€
Returns the ``test`` nodes found in ``except_clause`` nodes.
Returns ``[None]`` for except clauses without an exception given.
r™   r-   ÚexceptN©r%   r#   ©r0   r1   s     r3   Úget_except_clause_testsÚTryStmt.get_except_clause_testsý  s=   é € ð
 —M”MˆDØ�y‰y˜OÓ+Ø—m‘m AÑ&Ô&Ø˜Õ!Ø”
ò	 "ùs
   ‚7A½	AN)r7   r8   r9   r:   r#   r;   r·  r>   r"   r6   r3   r²  r²  ù  s   † Ø€DØ€Iõ	r6   r²  c                   ó,   • \ rS rSrSrSrSS jrS rSrg)ÚWithStmti	  r   r"   c                 ó˜   • / nU R                   SSS2    H1  nUR                  S:X  d  M  U[        UR                   S   U5      -  nM3     U$ )ze
Returns the a list of `Name` that the with statement defines. The
defined names are set after `as`.
r-   r„  r¶   Ú	with_item)r%   r#   r®  )r0   r“   rñ   r¼  s       r3   r�   ÚWithStmt.get_defined_names  sQ   € ð
 ˆØŸ™ q¨¨A vÔ.ˆIà�~‰~ Õ,Øœ¨	×(:Ñ(:¸1Ñ(=¸ÓOÑO’ñ /ð ˆr6   c                 ó^   • UR                  S5      nUc  [        S5      eUR                  S   $ )Nr¼  z2The name is not actually part of a with statement.r   )r   Ú
ValueErrorr%   )r0   rC   r1   s      r3   Úget_test_node_from_nameÚ WithStmt.get_test_node_from_name  s2   € Ø×#Ñ# KÓ0ˆØ‰<ÜÐQÓRÐRØ�}‰}˜QÑÐr6   Nr¢   )	r7   r8   r9   r:   r#   r;   r�   rÀ  r>   r"   r6   r3   rº  rº  	  s   † Ø€DØ€Iô
õ r6   rº  c                   óF   • \ rS rSr% Sr\\S'   \\S'   S rS rS r	S r
Srg	)
ÚImporti   r"   r	  Ú_aliasesc                 óÊ   •  U R                  5       U   nU R                  5        H!  nX;   d  M
  USUR                  U5      S-    s  $    [	        S5      e! [         a     NLf = f)zW
The path is the list of names that leads to the searched name.

:return list of Name:
Nr-   z+Name should be defined in the import itself)rÄ  ÚKeyErrorr	  r/   r¿  )r0   rC   r  s      r3   Úget_path_for_nameÚImport.get_path_for_name%  sm   € ð	à—=‘=“? 4Ñ(ˆDð —N‘NÖ$ˆDØ�|ØÐ1˜TŸZ™Z¨Ó-°Ñ1Ð2Ò2ñ %ô ÐFÓGÐGøô ó 	Ùð	ús   ‚A Á
A"Á!A"c                 ó   • g)NFr"   rR   s    r3   Ú	is_nestedÚImport.is_nested6  s   € Ør6   c                 ó&   • U R                   S   S:H  $ )Nr÷   r4  rô   rR   s    r3   Úis_star_importÚImport.is_star_import9  s   € Ø�}‰}˜RÑ  CÑ'Ð'r6   c                 ó   • [        S5      e)NzUse ImportFrom or ImportName)ÚNotImplementedErrorrR   s    r3   r�   ÚImport.get_defined_names<  s   € Ü!Ð"@ÓAÐAr6   N)r7   r8   r9   r:   r;   r   r=   rÇ  rÊ  rÍ  r�   r>   r"   r6   r3   rÃ  rÃ     s'   ‡ Ø€IØƒNØƒMòHò"ò(õBr6   rÃ  c                   óN   • \ rS rSrSrSrSS jrS rS r\	S 5       r
S rS	 rSrg
)Ú
ImportFromi@  r   r"   c                 ój   • U R                  5        VVs/ s H  u  p#U=(       d    UPM     snn$ s  snnf )zŸ
Returns the a list of `Name` that the import defines. The
defined names are set after `import` or in case an alias - `as` - is
present that name is returned.
)Ú_as_name_tuples)r0   r“   rC   Úaliass       r3   r�   ÚImportFrom.get_defined_namesD  s/   € ð 26×1EÑ1EÔ1GÔHÒ1G¡+ $�—˜’Ñ1GÒHÐHùÓHs   ”/c                 óB   • [        S U R                  5        5       5      $ )z-Mapping from alias to its corresponding name.c              3   ó6   #   • U  H  u  pUc  M
  X!4v •  M     g 7frP   r"   )rG  rC   rÖ  s      r3   rH  Ú&ImportFrom._aliases.<locals>.<genexpr>N  s    é € ð *Ò5K¡k dØó "�U•MÒ5Kùs   ‚	�
)ÚdictrÕ  rR   s    r3   rÄ  ÚImportFrom._aliasesL  s$   € äñ *°T×5IÑ5IÔ5Kó *ó *ð 	*r6   c                 ó˜   • U R                   SS   H  nUS;  d  M    O   WR                  S:X  a  UR                   S S S2   $ US:X  a  / $ U/$ )Nr-   ©Ú.z...Údotted_namer¶   Úimportrµ  )r0   Úns     r3   Úget_from_namesÚImportFrom.get_from_namesQ  sU   € Ø—‘˜q˜rÓ"ˆAØ˜Õ$Ùñ #ð �6‰6�]Ó"Ø—:‘:™c ˜c‘?Ð"Ø�(‹]ØˆIà�3ˆJr6   c                 óx   • SnU R                   SS  H$  nUS;   a  U[        UR                  5      -  nM#    U$    U$ )ú&The level parameter of ``__import__``.r   r-   NrÞ  ©r%   r^   rh   )r0   r  râ  s      r3   r  ÚImportFrom.level\  sG   € ð ˆØ—‘˜q˜rÓ"ˆAØ�LÓ Øœ˜QŸW™W›Ñ%’àØˆñ #ð
 ˆr6   c              #   ó  #   • U R                   S   nUS:X  a  U R                   S   nOUS:X  a  g UR                  S:X  a  UR                   S S S2   nOU/nU H/  nUR                  S:X  a  US 4v •  M  UR                   S S S2   v •  M1     g 7f)Nr÷   r+  r„  r4  Úimport_as_namesr¶   rC   rµ  )r0   ÚlastÚas_namesÚas_names       r3   rÕ  ÚImportFrom._as_name_tuplesg  s�   é € Ø�}‰}˜RÑ ˆØ�3‹;Ø—=‘= Ñ$‰DØ�S‹[Øà�9‰9Ð)Ó)Ø—}‘}¡S q SÑ)‰Hà�vˆHÛˆGØ�|‰|˜vÓ%Ø˜t�mÔ#à×&Ñ&¡s¨ sÑ+Ô+ò	  ùs   ‚B	Bc                 óª   • U R                  5       nU R                  S   S:X  a  U/$ U R                  5        VVs/ s H
  u  p#X/-   PM     snn$ s  snnf )z•
The import paths defined in an import statement. Typically an array
like this: ``[<Name: datetime>, <Name: date>]``.

:return list of list of Name:
r÷   r4  )rã  r%   rÕ  )r0   ÚdottedrC   rÖ  s       r3   r	  ÚImportFrom.get_pathsx  sS   € ð ×$Ñ$Ó&ˆà�=‰=˜Ñ Ó#Ø�8ˆOØ37×3GÑ3GÔ3IÔJÒ3I¡K D�˜”Ñ3IÒJÐJùÓJs   ºANr¢   )r7   r8   r9   r:   r#   r;   r�   rÄ  rã  rj   r  rÕ  r	  r>   r"   r6   r3   rÓ  rÓ  @  s;   † Ø€DØ€IôIò*ò
	ð ñó ðò,õ"Kr6   rÓ  c                   óR   • \ rS rSrSrSrSrSS jr\S 5       r	S r
S rS	 rS
 rSrg)Ú
ImportNamei†  zBFor ``import_name`` nodes. Covers normal imports without ``from``.r   r"   c                 óp   • U R                  5        VVs/ s H  u  p#U=(       d    US   PM     snn$ s  snnf )z°
Returns the a list of `Name` that the import defines. The defined names
is always the first name after `import` or in case an alias - `as` - is
present that name is returned.
r   ©Ú_dotted_as_names)r0   r“   r  rÖ  s       r3   r�   ÚImportName.get_defined_names‹  s5   € ð 59×4IÑ4IÔ4KÔLÒ4K¡[ T�× ˜˜a™Ò Ñ4KÒLÐLùÓLs   ”2c                 ó   • g)ræ  r   r"   rR   s    r3   r  ÚImportName.level“  s   € ð r6   c                 óX   • U R                  5        VVs/ s H  u  pUPM	     snn$ s  snnf rP   rõ  ©r0   r  rÖ  s      r3   r	  ÚImportName.get_paths˜  s'   € Ø(,×(=Ñ(=Ô(?Ô@Ò(?™˜“Ñ(?Ò@Ð@ùÓ@s   ”&c              #   óH  #   • U R                   S   nUR                  S:X  a  UR                   SSS2   nOU/nU Hc  nUR                  S:X  a  UR                   S   nUR                   S   nOSnUR                  S:X  a	  U/U4v •  MM  UR                   SSS2   U4v •  Me     g7f)z9Generator of (list(path), alias) where alias may be None.r-   Údotted_as_namesNr¶   Údotted_as_namer   rC   rµ  )r0   rþ  rì  rí  rÖ  s        r3   rö  ÚImportName._dotted_as_names›  s¯   é € àŸ-™-¨Ñ*ˆØ×ÑÐ#4Ó4Ø&×/Ñ/±°!°Ñ4‰Hà'Ð(ˆHãˆGØ�|‰|Ð/Ó/Ø×(Ñ(¨Ñ+�Ø!×*Ñ*¨1Ñ-‘à�Ø�|‰|˜vÓ%Ø�i Ð&Ô&ð ×&Ñ&¡s¨ sÑ+¨UÐ2Ô2ò  ùs   ‚B B"c           	      ó–   • [        U R                  5        VVs/ s H  u  pUb  M
  [        U5      S:”  d  M  SPM     snn5      $ s  snnf )zn
This checks for the special case of nested imports, without aliases and
from statement::

    import foo.bar
r-   )Úboolrö  r^   rû  s      r3   rÊ  ÚImportName.is_nested¯  sN   € ô ¨$×*?Ñ*?Ô*Aô 8Ò*A™;˜4Øó Ü),¨T«°Q©÷ Ñ*Aò 8ó 9ð 	9ùó 8s   ™	A
¦A
·A
c                 óB   • [        S U R                  5        5       5      $ )z-
:return list of Name: Returns all the alias
c              3   ó<   #   • U  H  u  pUc  M
  X!S   4v •  M     g 7f)Nr÷   r"   )rG  r  rÖ  s      r3   rH  Ú&ImportName._aliases.<locals>.<genexpr>½  s%   é € ð *Ò9P©+¨$Øó &�U ™HÕ%Ò9Pùs   ‚	�)rÛ  rö  rR   s    r3   rÄ  ÚImportName._aliases¹  s&   € ô ñ *¸×9NÑ9NÔ9Pó *ó *ð 	*r6   Nr¢   )r7   r8   r9   r:   rK   r#   r;   r�   rj   r  r	  rö  rÊ  rÄ  r>   r"   r6   r3   ró  ró  †  s>   † ÙLØ€DØ€IôMð ñó ðòAò3ò(9õ*r6   ró  c                   óF   • \ rS rSrSrSr\S 5       r\S 5       rSS jr	Sr
g)	ÚKeywordStatementiÁ  zâ
For the following statements: `assert`, `del`, `global`, `nonlocal`,
`raise`, `return`, `yield`.

`pass`, `continue` and `break` are not in there, because they are just
simple keywords and the parser reduces it to a keyword.
r"   c                 ó    • SU R                   -  $ )zr
Keyword statements start with the keyword and end with `_stmt`. You can
crosscheck this with the Python grammar.
z%s_stmt)r×   rR   s    r3   r#   ÚKeywordStatement.typeË  s   € ð ˜4Ÿ<™<Ñ'Ð'r6   c                 ó4   • U R                   S   R                  $ ©Nr   )r%   rh   rR   s    r3   r×   ÚKeywordStatement.keywordÓ  s   € à�}‰}˜QÑ×%Ñ%Ð%r6   c                 óŒ   • U R                   nUS:X  a  [        U R                  S   U5      $ US;   a  U R                  SS S2   $ / $ )NÚdelr-   )ÚglobalÚnonlocalr¶   )r×   r®  r%   )r0   r“   r×   s      r3   r�   Ú"KeywordStatement.get_defined_names×  sL   € Ø—,‘,ˆØ�eÓÜ! $§-¡-°Ñ"2°OÓDÐDØÐ,Ó,Ø—=‘=   A Ñ&Ð&Øˆ	r6   Nr¢   )r7   r8   r9   r:   rK   r;   rj   r#   r×   r�   r>   r"   r6   r3   r	  r	  Á  s9   † ñð €Iàñ(ó ð(ð ñ&ó ð&÷r6   r	  c                   ó(   • \ rS rSrSr\S 5       rSrg)Ú
AssertStmtià  r"   c                 ó    • U R                   S   $ r[  rô   rR   s    r3   Ú	assertionÚAssertStmt.assertionã  r]  r6   N)r7   r8   r9   r:   r;   rj   r  r>   r"   r6   r3   r  r  à  s   † Ø€Iàñ ó ó r6   r  c                   ó   • \ rS rSrSrS rSrg)Ú
GlobalStmtiè  r"   c                 ó&   • U R                   SS S2   $ )Nr-   r¶   rô   rR   s    r3   Úget_global_namesÚGlobalStmt.get_global_namesë  s   € Ø�}‰}˜Q˜T ˜TÑ"Ð"r6   N)r7   r8   r9   r:   r;   r  r>   r"   r6   r3   r  r  è  s   † Ø€Iõ#r6   r  c                   ó   • \ rS rSrSrSrg)Ú
ReturnStmtiï  r"   Nro   r"   r6   r3   r  r  ï  rp   r6   r  c                   ó   • \ rS rSrSrSrSrg)Ú	YieldExprió  rb  r"   Nrª   r"   r6   r3   r!  r!  ó  r¥  r6   r!  c                 óØ  • / nU R                   S;   a)  U R                  SSS2    H  nU[        X15      -  nM     U$ U R                   S;   a  U[        U R                  S   U5      -  nU$ U R                   S;   aß  U R                  S   S:w  aÊ  U R                  S	   nUR                  S
   S:X  a   UR                  UR                  S   5        U$ UR                  S
   S:X  au  U(       an  U R                  SSS	2    HX  nUR                   S:X  a!  UR                  UR                  S   5          U$ UR                   S:X  d  MF  UR                  U5          U$    U$ UR                  U 5        U$ )z_
A helper function to find the defined names in statements, for loops and
list comprehensions.
)Útestlist_star_exprÚtestlist_compÚexprlistÚtestlistNr¶   )ÚatomÚ	star_exprr-   )ÚpowerÚ	atom_exprr„  ú**r÷   r   rß  Ú[ÚtrailerrC   )r#   r%   r®  r  )Úcurrentr“   rñ   r  r-  r1   s         r3   r®  r®  ø  su  € ð
 €EØ‡|�|ÐVÓVØ×%Ñ%¡c¨ cÔ*ˆEØ”^ EÓ;Ñ;ŠEñ +ð& €Lð# 
�‰Ð.Ó	.Ø” × 0Ñ 0°Ñ 3°_ÓEÑEˆð  €Lð 
�‰Ð/Ó	/Ø×Ñ˜BÑ 4Ó'Ø×&Ñ& rÑ*ˆGØ×Ñ Ñ" cÓ)Ø—‘˜W×-Ñ-¨aÑ0Ô1ð €Lð ×!Ñ! !Ñ$¨Ó+¶Ø#×,Ñ,¨R¨V°¨VÔ4�DØ—y‘y IÓ-ØŸ™ T§]¡]°1Ñ%5Ô6Øð €Lð —y‘y FÕ*ØŸ™ TÔ*Øð €Lñ 5ð €Lð 	�‰�WÔØ€Lr6   c                   ó2   • \ rS rSrSrSrSS jrS rS rSr	g)	ÚExprStmti  r   r"   c                 óv  • / nU R                   S   R                  S:X  a  [        U R                   S   U5      n[        S[	        U R                   5      S-
  S5       VVs/ s HH  nSU R                   US-      R
                  ;   d  M%  [        U R                   U   U5        H  nUPM     MJ     snnU-   $ s  snnf )z7
Returns a list of `Name` defined before the `=` sign.
r-   Ú	annassignr   r¶   Ú=)r%   r#   r®  Úranger^   rh   )r0   r“   rñ   r.  rC   s        r3   r�   ÚExprStmt.get_defined_names  s¿   € ð ˆØ�=‰=˜Ñ× Ñ  KÓ/Ü" 4§=¡=°Ñ#3°_ÓEˆEô ˜1œc $§-¡-Ó0°1Ñ4°aÔ8ô
â8�Ø�d—m‘m A¨¡EÑ*×0Ñ0Ñ0ó ô ' t§}¡}°QÑ'7¸×I�ó ñ Jñ Ù8ò
ð
 ñð 	ùó 
s   Á$B5Â'B5c                 ó¶   • U R                   S   nUR                  S:X  a9  [        UR                   5      S:X  a  UR                   S   nU$ UR                   S   nU$ )z*Returns the right-hand-side of the equals.r÷   r2  é   r©  r-   ©r%   r#   r^   r¶  s     r3   Úget_rhsÚExprStmt.get_rhs'  sW   € à�}‰}˜RÑ ˆØ�9‰9˜Ó#Ü�4—=‘=Ó! QÓ&Ø—}‘} QÑ'�ð ˆð —}‘} QÑ'�Øˆr6   c              #   óÜ   #   • U R                   S   nUR                  S:X  a)  [        UR                   5      S::  a  gUR                   S   nUv •  U R                   SSS2    Sh  v•N   g N7f)zJ
Returns a generator of `+=`, `=`, etc. or None if there is no operation.
r-   r2  r¶   Nr©  r8  ©r0   r:  s     r3   Úyield_operatorsÚExprStmt.yield_operators1  s`   é € ð —‘˜aÑ ˆØ�:‰:˜Ó$Ü�5—>‘>Ó" aÓ'Øà—N‘N 1Ñ%ˆEØŠà—=‘=   A Ñ&×&Ó&ùs   ‚A"A,Á$A*Á%A,Nr¢   )
r7   r8   r9   r:   r#   r;   r�   r9  r=  r>   r"   r6   r3   r0  r0    s   † Ø€DØ€Iôòõ'r6   r0  c                   ó"   • \ rS rSrSrSS jrSrg)Ú	NamedExpri@  r   c                 ó4   • [        U R                  S   U5      $ r  r­  r•   s     r3   r�   ÚNamedExpr.get_defined_namesC  r°  r6   r"   Nr¢   )r7   r8   r9   r:   r#   r�   r>   r"   r6   r3   r@  r@  @  s   † Ø€D÷Ar6   r@  c                   ó°   ^ • \ rS rSrSrSrSU 4S jjr\S 5       r\S 5       r	\S 5       r
S r\S	 5       rSS
 jr\S 5       rS rSU 4S jjrS rSrU =r$ )r8  iG  zÍ
It's a helper class that makes business logic with params much easier. The
Python grammar defines no ``param`` node. It defines it in a different way
that is not really suited to working with parameters.
r   c                 ó0   >• [         TU ]  U5        X l        g rP   )rÜ   rÝ   r&   )r0   r%   r&   rß   s      €r3   rÝ   ÚParam.__init__O  s   ø€ Ü‰Ñ˜Ô"Ø�r6   c                 óX   • U R                   S   nUS;   a  [        UR                  5      $ g)zK
Is `0` in case of `foo`, `1` in case of `*foo` or `2` in case of
`**foo`.
r   ©r4  r+  rç  r<  s     r3   Ú
star_countÚParam.star_countS  s,   € ð —‘˜aÑ ˆØ�KÓÜ�u—{‘{Ó#Ð#Ør6   c                 ó¾   • U R                   S   S:H  n U R                   S[        U5      -
     S:X  a  U R                   S[        U5      -
     $ g! [         a     gf = f)zc
The default is the test node that appears after the `=`. Is `None` in
case no default is present.
r÷   r�   r„  r3  N)r%   rk   r7  )r0   Ú	has_commas     r3   ÚdefaultÚParam.default^  se   € ð —M‘M "Ñ%¨Ñ,ˆ	ð	Ø�}‰}˜R¤# i£.Ñ0Ñ1°SÓ8Ø—}‘} R¬#¨i«.Ñ%8Ñ9Ð9ð 9øäó 	Ùð	ús   ”9A Á
AÁAc                 óÆ   • U R                  5       nUR                  S:X  aA  UR                  S   S:X  d   e[        UR                  5      S:X  d   eUR                  S   nU$ g)zb
The default is the test node that appears after `:`. Is `None` in case
no annotation is present.
r5  r-   r,   r©  r¶   N)Ú_tfpdefr#   r%   r^   )r0   r5  r  s      r3   r  ÚParam.annotationk  s`   € ð —‘“ˆØ�;‰;˜(Ó"Ø—?‘? 1Ñ%¨Ó,Ð,Ð,Ü�v—‘Ó'¨1Ó,Ð,Ð,ØŸ™¨Ñ+ˆJØÐàr6   c                 óV   • [        U R                  S   S;   5      nU R                  U   $ )z!
tfpdef: see e.g. grammar36.txt.
r   rG  )rk   r%   )r0   Úoffsets     r3   rO  ÚParam._tfpdefz  s+   € ô �T—]‘] 1Ñ%¨Ñ4Ó5ˆØ�}‰}˜VÑ$Ð$r6   c                 ó˜   • U R                  5       R                  S:X  a  U R                  5       R                  S   $ U R                  5       $ )z
The `Name` leaf of the param.
r5  r   )rO  r#   r%   rR   s    r3   rC   Ú
Param.name�  s;   € ð
 �<‰<‹>×Ñ (Ó*Ø—<‘<“>×*Ñ*¨1Ñ-Ð-à—<‘<“>Ð!r6   c                 ó   • U R                   /$ rP   )rC   r•   s     r3   r�   ÚParam.get_defined_names‹  s   € Ø—	‘	ˆ{Ðr6   c                 ó^  • U R                   R                  R                  U 5      n U R                   R                  R                  S5      nX:”  a  US-  n U R                   R                  R                  S5      nX:”  a  US-  nUS-
  $ ! [         a     NAf = f! [         a     US-
  $ f = f)z2
Property for the positional index of a paramter.
r4  r¶   r6  r-   )r&   r%   r/   r¿  )r0   r/   Úkeyword_only_indexs      r3   Úposition_indexÚParam.position_indexŽ  s¹   € ð
 —‘×$Ñ$×*Ñ*¨4Ó0ˆð	Ø!%§¡×!5Ñ!5×!;Ñ!;¸CÓ!@ÐØÓ)à˜‘
�ð	Ø!%§¡×!5Ñ!5×!;Ñ!;¸CÓ!@ÐØÓ)à˜‘
�ð �q‰yÐøô ó 	Ùð	ûô ó 	ØØ�q‰yÐð	ús#   §/B Á/B Â
BÂBÂ
B,Â+B,c                 ó&   • U R                  SS5      $ )z-
Returns the function/lambda of a parameter.
r*   r`  )r   rR   s    r3   Úget_parent_functionÚParam.get_parent_function¤  s   € ð ×#Ñ# I¨yÓ9Ð9r6   c                 ó„   >• U(       a  [         TU ]  U5      $ U R                  nUS   S:X  a  USS nU R                  UUS9$ )z 
Like all the other get_code functions, but includes the param
`include_comma`.

:param include_comma bool: If enabled includes the comma in the string output.
r÷   r�   N)Úinclude_prefix)rÜ   Úget_coder%   Ú_get_code_for_children)r0   r`  Úinclude_commar%   rß   s       €r3   ra  ÚParam.get_codeª  sV   ø€ ö Ü‘7Ñ# NÓ3Ð3à—=‘=ˆØ�B‰<˜3ÓØ  �}ˆHØ×*Ñ*ØØ)ð +ð 
ð 	
r6   c                 óÊ   • U R                   c  SOSU R                   R                  5       -  nS[        U 5      R                  < S[	        U R                  5       5      U-   < S3$ )Nrû   z=%sr   r‰   r€   )rL  ra  r#   r7   r<   rO  )r0   rL  s     r3   r‚   ÚParam.__repr__¼  sI   € ØŸ™Ñ,‘"°%¸$¿,¹,×:OÑ:OÓ:QÑ2Q‰Ü! $›Z×0Ô0´#°d·l±l³nÓ2EÈÔ2OÐPÐPr6   )r&   rP   r¢   )TT)r7   r8   r9   r:   rK   r#   rÝ   rj   rH  rL  r  rO  rC   r�   rZ  r]  ra  r‚   r>   rÿ   r   s   @r3   r8  r8  G  s˜   ø† ñð
 €D÷ð ñó ðð ñ
ó ð
ð ñó ðò%ð ñ"ó ð"ôð ñó ðò*:÷
÷$Qð Qr6   r8  c                   ó&   • \ rS rSrSrSrSS jrSrg)ÚSyncCompForiÁ  r   r"   c                 ó4   • [        U R                  S   U5      $ )z>
Returns the a list of `Name` that the comprehension defines.
r-   r­  r•   s     r3   r�   ÚSyncCompFor.get_defined_namesÅ  s   € ô
 ˜dŸm™m¨AÑ.°Ó@Ð@r6   Nr¢   )r7   r8   r9   r:   r#   r;   r�   r>   r"   r6   r3   rh  rh  Á  s   † Ø€DØ€I÷Ar6   rh  c                   ó<   • \ rS rSrSrS rS rS rS rS r	S r
S	rg
)r  iÒ  zG
This class exists for the sole purpose of creating an immutable dict.
c                 ó   • Xl         g rP   ©Ú_dict)r0   r  s     r3   rÝ   ÚUsedNamesMapping.__init__Ö  s   € Ø�
r6   c                 ó    • U R                   U   $ rP   rm  )r0   Úkeys     r3   Ú__getitem__ÚUsedNamesMapping.__getitem__Ù  s   € Ø�z‰z˜#‰Ðr6   c                 ó,   • [        U R                  5      $ rP   )r^   rn  rR   s    r3   Ú__len__ÚUsedNamesMapping.__len__Ü  s   € Ü�4—:‘:‹Ðr6   c                 ó,   • [        U R                  5      $ rP   )Úiterrn  rR   s    r3   Ú__iter__ÚUsedNamesMapping.__iter__ß  rÑ   r6   c                 ó   • [        U 5      $ rP   )ÚidrR   s    r3   rÏ   ÚUsedNamesMapping.__hash__â  s   € Ü�$‹xˆr6   c                 ó   • XL $ rP   r"   rÉ   s     r3   rË   ÚUsedNamesMapping.__eq__å  s
   € àˆ}Ðr6   rm  N)r7   r8   r9   r:   rK   rÝ   rr  ru  ry  rÏ   rË   r>   r"   r6   r3   r  r  Ò  s%   † ñòòòò òõr6   r  )IrK   r¯   Úcollections.abcr   Útypingr   r   Ú
parso.treer   r   r   r	   r
   r   Úparso.python.prefixr   Úparso.utilsr   ÚsetÚ_FLOW_CONTAINERSrl  rï   rœ   rž   r    r@   rM   rc   rm   rr   ru   rx   r{   r…   rŒ   r¤   r§   r¬   r¼   rÁ   rÄ   rÇ   rÓ   rÖ   rÙ   r  r  r  r&  r@  rB  r‚  r‘  r“  r¤  r§  r²  rº  rÃ  rÓ  ró  r	  r  r  r  r!  r®  r0  r@  r8  rh  ÚCompForr  r"   r6   r3   Ú<module>rˆ     só  ðñ*óX 
Ý #ß ç R× RÝ ,Ý #áò <ó =Ð á˜w¨Ð6Ó7Ð:JÑJÐ áÚ:óàñÐ ñ ò ó Ð ñ �˜}Ð-Ó.€÷ñ ÷>ñ ô.%�˜dô %ô08˜:ô 8ô�[ (ô ô�˜dô ô�k 9ô ô�i ô ô
Ð$ô 
ôDˆjô Dô1Ðô 1ôhˆjô ôˆWô ô
5ˆWô 5ô"�Jô ô�:ô ô�ô ÷ ñ  ô$Ð#Ð%;ô ô
Ð"Ð$:ô ô
4GˆN˜Nô 4Gôn3 ˆUô 3 ôl�ô ô
�%ô ô6ˆKô ò0*ôZmˆ{ô mô`*EˆXô *EôZˆ>ô ô*ˆTô *ôZ�ô ô
Aˆdô Aôˆdô ô  ˆtô  ô.Bˆ^ô Bô@CK�ô CKôL8*�ô 8*ôv�~ô ô> Ð!ô  ô#Ð!ô #ôÐ!ô ô�ô ò
ô:('ˆ~˜~ô ('ôVA�ô AôwQˆNô wQôt	A�.ô 	Að €ô�wõ r6   