ó
    Ð]jxs  ã                   óX  • S 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  SS	KJr  SS
KJrJr  SSKJr  SSKJrJr  SSKJrJr  SSKJr  SSKJr  SSKJr  S r S r!S 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(g) a`  
There are a couple of classes documented in here:

- :class:`.BaseName` as an abstact base class for almost everything.
- :class:`.Name` used in a lot of places
- :class:`.Completion` for completions
- :class:`.BaseSignature` as a base class for signatures
- :class:`.Signature` for :meth:`.Script.get_signatures` only
- :class:`.ParamName` used for parameters of signatures
- :class:`.Refactoring` for refactorings
- :class:`.SyntaxError` for :meth:`.Script.get_syntax_errors` only

These classes are the much biggest part of the API, because they contain
the interesting information about all operations.
é    N)ÚPath)ÚOptional)Úsettings)Údebug)Úunite)Úmemoize_method)Ú	MixedName)Ú
ImportNameÚSubModuleName)ÚStubModuleValue)Úconvert_namesÚconvert_values)ÚValueSetÚHasNoContext)ÚKeywordName)Úcompletion_cache)Úfilter_follow_importsc                 ó   • [        U S S9$ )Nc                 ó,   • U R                   =(       d    S$ ©N©r   r   )Ú	start_pos©Úss    ÚM/home/mande/repo/quber/.venv/lib/python3.13/site-packages/jedi/api/classes.pyÚ<lambda>Ú*_sort_names_by_start_pos.<locals>.<lambda>#   s   €  q§{¡{×'<°fÐ'<ó    ©Úkey)Úsorted)Únamess    r   Ú_sort_names_by_start_posr#   "   s   € Ü�%Ñ<Ñ=Ð=r   c                 ó  •  UR                  5       n[        UR                  5       5      nUR	                  5        Vs/ s H  oDPM     nn[        U5       Vs/ s H  n[        X5      PM     sn$ ! [         a    / s $ f = fs  snf s  snf )zY
List sub-definitions (e.g., methods in class).

:type scope: Scope
:rtype: list of Name
)Ú
as_contextr   ÚnextÚget_filtersÚvaluesr#   ÚName)Úinference_stateÚvalueÚcontextÚfilterÚnamer"   Úns          r   Údefined_namesr0   &   s‚   € ðØ×"Ñ"Ó$ˆô �'×%Ñ%Ó'Ó(€FØ$Ÿm™mœoÓ.šo�dŠT™o€EÐ.Ü.FÀuÔ.MÓNÒ.M¨ŒD�Ö$Ñ.MÑNÐNøô	 ó ØŠ	ðüò /ùÚNs   ‚A/ ½BÁBÁ/A>Á=A>c                 ón   • U  Vs/ s H#  n[        UR                  UR                  5      PM%     sn$ s  snf ©N)r)   r*   r.   )r(   Úcs     r   Ú_values_to_definitionsr4   6   s+   € Ù5;Ó<²V°ŒD�×"Ñ" A§F¡FÖ+±VÑ<Ð<ùÒ<s   …*2c                   óö  • \ rS rSrSrSSSSSSSSSSSS	S
.r\" S SS0R                  5        5       5      rS r	\
S 5       r\S\\   4S j5       r\S 5       r\S 5       r\S 5       rS r\S 5       r\S 5       rS rS rS1S jrS rS r\S 5       r\S 5       rS  rS! r\R@                  " S"5      SSSSS#.S$ j5       r!\R@                  " S%5      SSS&.S' j5       r"S( r#S) r$S2S* jr%S3S+ jr&S, r'S- r(S. r)S/r*g0)4ÚBaseNameé:   zA
The base class for all definitions, completions and signatures.
zos.pathÚosÚioÚ	functoolsÚcollectionsÚsocketÚsqlite3)Ú	posixpathÚ
riscospathÚntpathÚ
os2emxpathÚmacpathÚgenericpathÚposixÚ_ioÚ
_functoolsÚ_collectionsÚ_socketÚ_sqlite3c              #   ó^   #   • U  H#  u  p[        UR                  S 5      5      U4v •  M%     g7f)Ú.N)ÚtupleÚsplit)Ú.0ÚkÚvs      r   Ú	<genexpr>ÚBaseName.<genexpr>M   s.   é € ð ò B±v¸œ5 §¡¨£Ó.°Õ2ò Bùs   ‚+-zargparse._ActionsContainerzargparse.ArgumentParserc                 ó\   • Xl         X l         [        U R                  [        5      U l        g r2   )Ú_inference_stateÚ_nameÚ
isinstancer   Ú
is_keyword)Úselfr*   r.   s      r   Ú__init__ÚBaseName.__init__Q   s&   € Ø /ÔØŒ
ð	ô % T§Z¡Z´Ó=ˆ�r   c                 ó6   • U R                   R                  5       $ r2   )rU   Úget_root_context©rX   s    r   Ú_get_module_contextÚBaseName._get_module_contextY   s   € ð
 �z‰z×*Ñ*Ó,Ð,r   Úreturnc                 ó¸   • U R                  5       nUR                  5       (       d  UR                  5       (       d   U R                  5       R                  5       nU$ g)zE
Shows the file path of a module. e.g. ``/usr/lib/python3.14/os.py``
N)r^   Úis_stubÚis_compiledÚ
py__file__)rX   ÚmoduleÚpaths      r   Úmodule_pathÚBaseName.module_path`   sN   € ð
 ×)Ñ)Ó+ˆØ�>‰>×Ñ 6×#5Ñ#5×#7Ñ#7ð $(×#;Ñ#;Ó#=×#HÑ#HÓ#JˆDØˆKàr   c                 ó6   • U R                   R                  5       $ )zq
Name of variable/function/class/module.

For example, for ``x = None`` it returns ``'x'``.

:rtype: str or None
)rU   Úget_public_namer]   s    r   r.   ÚBaseName.namen   s   € ð �z‰z×)Ñ)Ó+Ð+r   c                 ó~  • U R                   R                  nSnUb:  UR                  5       nUb'  UR                  S:X  a  UR	                  5       (       a  Sn[        U R                   [        5      (       d  U(       a-  U R                   R                  5        H  nUR                  s  $    U R                   R                  $ )a1  
The type of the definition.

Here is an example of the value of this attribute.  Let's consider
the following source.  As what is in ``variable`` is unambiguous
to Jedi, :meth:`jedi.Script.infer` should return a list of
definition for ``sys``, ``f``, ``C`` and ``x``.

>>> from jedi import Script
>>> source = '''
... import keyword
...
... class C:
...     pass
...
... class D:
...     pass
...
... x = D()
...
... def f():
...     pass
...
... for variable in [keyword, f, C, x]:
...     variable'''

>>> script = Script(source)
>>> defs = script.infer()

Before showing what is in ``defs``, let's sort it by :attr:`line`
so that it is easy to relate the result to the source code.

>>> defs = sorted(defs, key=lambda d: d.line)
>>> print(defs)  # doctest: +NORMALIZE_WHITESPACE
[<Name full_name='keyword', description='module keyword'>,
 <Name full_name='__main__.C', description='class C'>,
 <Name full_name='__main__.D', description='instance D'>,
 <Name full_name='__main__.f', description='def f'>]

Finally, here is what you can get from :attr:`type`:

>>> defs = [d.type for d in defs]
>>> defs[0]
'module'
>>> defs[1]
'class'
>>> defs[2]
'instance'
>>> defs[3]
'function'

Valid values for type are ``module``, ``class``, ``instance``, ``function``,
``param``, ``path``, ``keyword``, ``property`` and ``statement``.

FÚimport_fromT)	rU   Ú	tree_nameÚget_definitionÚtypeÚis_definitionrV   r   ÚinferÚapi_type)rX   rn   ÚresolveÚ
definitionr+   s        r   rp   ÚBaseName.typey   s–   € ðr —J‘J×(Ñ(ˆ	ØˆØÑ à"×1Ñ1Ó3ˆJØÑ%¨*¯/©/¸]Ó*JØ×+Ñ+×-Ñ-Ø�ä�d—j‘j¤-×0Ñ0¶GØŸ™×)Ñ)Ö+�Ø—~‘~Ò%ñ ,à�z‰z×"Ñ"Ð"r   c                 ó>   • U R                  5       R                  5       $ )a  
The module name, a bit similar to what ``__name__`` is in a random
Python module.

>>> from jedi import Script
>>> source = 'import json'
>>> script = Script(source, path='example.py')
>>> d = script.infer()[0]
>>> print(d.module_name)  # doctest: +ELLIPSIS
json
)r^   Ú
py__name__r]   s    r   Úmodule_nameÚBaseName.module_nameÀ   s   € ð ×'Ñ'Ó)×4Ñ4Ó6Ð6r   c                 óÀ   • U R                  5       R                  5       n[        U[        5      (       a  [	        S UR
                   5       5      $ UR                  5       $ )z,
Returns True, if this is a builtin module.
c              3   ó@   #   • U  H  oR                  5       v •  M     g 7fr2   )rc   )rN   rP   s     r   rQ   Ú-BaseName.in_builtin_module.<locals>.<genexpr>Õ   s   é € ÐIÒ0H¨1—}‘}—�Ò0Hùó   ‚)r^   Ú	get_valuerV   r   ÚanyÚnon_stub_value_setrc   )rX   r+   s     r   Úin_builtin_moduleÚBaseName.in_builtin_moduleÏ   sN   € ð ×(Ñ(Ó*×4Ñ4Ó6ˆÜ�eœ_×-Ñ-ÜÑI°×0HÒ0HÓIÓIÐIØ× Ñ Ó"Ð"r   c                 ó@   • U R                   R                  nUc  gUS   $ )z7The line where the definition occurs (starting with 1).Nr   ©rU   r   ©rX   r   s     r   ÚlineÚBaseName.lineØ   ó&   € ð —J‘J×(Ñ(ˆ	ØÑØØ˜‰|Ðr   c                 ó@   • U R                   R                  nUc  gUS   $ )z9The column where the definition occurs (starting with 0).Né   r…   r†   s     r   ÚcolumnÚBaseName.columnà   r‰   r   c                 óÄ   • U R                   R                  c  gU R                   R                  R                  5       nUc  U R                   R                  $ UR                  $ )z…
The (row, column) of the start of the definition range. Rows start with
1, columns start with 0.

:rtype: Optional[Tuple[int, int]]
N)rU   rn   ro   r   )rX   ru   s     r   Úget_definition_start_positionÚ&BaseName.get_definition_start_positionè   sQ   € ð �:‰:×ÑÑ'ØØ—Z‘Z×)Ñ)×8Ñ8Ó:ˆ
ØÑØ—:‘:×'Ñ'Ð'Ø×#Ñ#Ð#r   c                 ó„  • U R                   R                  c  gU R                   R                  R                  5       nUc   U R                   R                  R                  $ U R                  S;   aF  UR                  5       nUR                  S:X  a  UR                  5       R                  $ UR                  $ UR                  $ )zƒ
The (row, column) of the end of the definition range. Rows start with
1, columns start with 0.

:rtype: Optional[Tuple[int, int]]
N)ÚfunctionÚclassÚnewline)rU   rn   ro   Úend_posrp   Úget_last_leafÚget_previous_leaf)rX   ru   Ú	last_leafs      r   Úget_definition_end_positionÚ$BaseName.get_definition_end_positionö   sŸ   € ð �:‰:×ÑÑ'ØØ—Z‘Z×)Ñ)×8Ñ8Ó:ˆ
ØÑØ—:‘:×'Ñ'×/Ñ/Ð/Ø�9‰9Ð-Ó-Ø"×0Ñ0Ó2ˆIØ�~‰~ Ó*Ø ×2Ñ2Ó4×<Ñ<Ð<Ø×$Ñ$Ð$Ø×!Ñ!Ð!r   Fc                 óÖ   • [        U R                  [        5      (       a  U(       a  gU R                  5       nU(       a  U$ U R	                  5       nU(       a  U(       a  US-   U-   $ XC-   $ )a©  
Return a document string for this completion object.

Example:

>>> from jedi import Script
>>> source = '''\
... def f(a, b=1):
...     "Document for function f."
... '''
>>> script = Script(source, path='example.py')
>>> doc = script.infer(1, len('def f'))[0].docstring()
>>> print(doc)
f(a, b=1)
<BLANKLINE>
Document for function f.

Notice that useful extra information is added to the actual
docstring, e.g. function signatures are prepended to their docstrings.
If you need the actual docstring, use ``raw=True`` instead.

>>> print(script.infer(1, len('def f'))[0].docstring(raw=True))
Document for function f.

:param fast: Don't follow imports that are only one level deep like
    ``import foo``, but follow ``from foo import bar``. This makes
    sense for speed reasons. Completing `import a` is slow if you use
    the ``foo.docstring(fast=False)`` on every object, because it
    parses all libraries starting with ``a``.
Ú z

)rV   rU   r
   Ú_get_docstringÚ_get_docstring_signature)rX   ÚrawÚfastÚdocÚsignature_texts        r   Ú	docstringÚBaseName.docstring	  s\   € ô> �d—j‘j¤*×-Ñ-¶$ØØ×!Ñ!Ó#ˆÞØˆJà×6Ñ6Ó8ˆÞžcØ! FÑ*¨SÑ0Ð0à!Ñ'Ð'r   c                 ó6   • U R                   R                  5       $ r2   )rU   Ú	py__doc__r]   s    r   r�   ÚBaseName._get_docstring4  s   € Ø�z‰z×#Ñ#Ó%Ð%r   c                 óL   • SR                  S U R                  SS9 5       5      $ )NÚ
c              3   óB   #   • U  H  nUR                  5       v •  M     g 7fr2   )Ú	to_string)rN   Ú	signatures     r   rQ   Ú4BaseName._get_docstring_signature.<locals>.<genexpr>8  s#   é € ð 
âE�	ð ×Ñ×!Ð!ÚEùs   ‚T)Úfor_docstring)ÚjoinÚ_get_signaturesr]   s    r   rž   Ú!BaseName._get_docstring_signature7  s.   € Ø�y‰yñ 
à!×1Ñ1ÀÐ1ÑEó
ó 
ð 	
r   c                 óÂ  • U R                   nU R                  R                  nUS:X  a   US-   U R                  R                  5       -   $ US;   d  Uc(  US:X  a  SnUS-   U R                  R	                  5       -   $ UR                  SS9=(       d    UnUR                  SS	9n[        R                  " S
SU5      n[        R                  " SSU5      R                  5       nU$ )a¢  
A description of the :class:`.Name` object, which is heavily used
in testing. e.g. for ``isinstance`` it returns ``def isinstance``.

Example:

>>> from jedi import Script
>>> source = '''
... def f():
...     pass
...
... class C:
...     pass
...
... variable = f if random.choice([0,1]) else C'''
>>> script = Script(source)  # line is maximum by default
>>> defs = script.infer(column=3)
>>> defs = sorted(defs, key=lambda d: d.line)
>>> print(defs)  # doctest: +NORMALIZE_WHITESPACE
[<Name full_name='__main__.f', description='def f'>,
 <Name full_name='__main__.C', description='class C'>]
>>> str(defs[0].description)
'def f'
>>> str(defs[1].description)
'class C'

ÚparamÚ )r’   r“   re   Úinstancer’   ÚdefT)Úinclude_setitemF)Úinclude_prefixz	#[^\n]+\nz\s+)
rp   rU   rn   r«   rj   ro   Úget_codeÚreÚsubÚstrip)rX   Útyprn   ru   Útxts        r   ÚdescriptionÚBaseName.description=  sÕ   € ð: �i‰iˆØ—J‘J×(Ñ(ˆ	Ø�'‹>Ø˜‘9˜tŸz™z×3Ñ3Ó5Ñ5Ð5ØÐ=Ó=ÀÑARØ�jÓ à�Ø˜‘9˜tŸz™z×9Ñ9Ó;Ñ;Ð;à×-Ñ-¸dÐ-ÐC×PÀyˆ
ð ×!Ñ!°Ð!Ð7ˆä�fŠf�\ 3¨Ó,ˆä�fŠf�V˜S #Ó&×,Ñ,Ó.ˆØˆ
r   c                 óø   • U R                   R                  (       d  gU R                   R                  SS9nUc  g[        U5      n U R                  US      US'   SR                  U5      $ ! [
         a     Nf = f)ae  
Dot-separated path of this object.

It is in the form of ``<module>[.<submodule>[...]][.<object>]``.
It is useful when you want to look up Python manual of the
object at hand.

Example:

>>> from jedi import Script
>>> source = '''
... import os
... os.path.join'''
>>> script = Script(source, path='example.py')
>>> print(script.infer(3, len('os.path.join'))[0].full_name)
os.path.join

Notice that it returns ``'os.path.join'`` instead of (for example)
``'posixpath.join'``. This is not correct, since the modules name would
be ``<module 'posixpath' ...>```. However most users find the latter
more practical.
NT)Úinclude_module_namesr   rK   )rU   Úis_value_nameÚget_qualified_namesÚlistÚ_mappingÚKeyErrorr¯   )rX   r"   s     r   Ú	full_nameÚBaseName.full_namen  s{   € ð0 �z‰z×'×'Øà—
‘
×.Ñ.ÀDÐ.ÐIˆØ‰=Øä�U“ˆð	Ø—}‘} U¨1¡XÑ.ˆE�!‰Hð �x‰x˜‹Ðøô ó 	Ùð	ús   ÁA, Á,
A9Á8A9c                 óŠ   • U R                   R                  (       d  gU R                   R                  5       R                  5       $ )z=
Returns True if the current name is defined in a stub file.
F)rU   rÃ   r\   rb   r]   s    r   rb   ÚBaseName.is_stub•  s0   € ð �z‰z×'×'Øà�z‰z×*Ñ*Ó,×4Ñ4Ó6Ð6r   c                 ó–   • U R                   R                  nUc  gUR                  5       =(       a    UR                  R                  S:H  $ )zƒ
Checks if a name is defined as ``self.foo = 3``. In case of self, this
function would return False, for foo it would return True.
FÚtrailer)rU   rn   rq   Úparentrp   )rX   rn   s     r   Úis_side_effectÚBaseName.is_side_effectž  sA   € ð
 —J‘J×(Ñ(ˆ	ØÑØØ×&Ñ&Ó(×O¨Y×-=Ñ-=×-BÑ-BÀiÑ-OÐOr   zgoto on name)Úfollow_importsÚfollow_builtin_importsÚ
only_stubsÚprefer_stubsc                ó$  • U R                   R                  (       d  / $ U R                   R                  5       nU(       a  [        XR5      n[	        UUUS9nU Vs/ s H*  nX`R                   :X  a  U O[        U R                  U5      PM,     sn$ s  snf )a  
Like :meth:`.Script.goto` (also supports the same params), but does it
for the current name. This is typically useful if you are using
something like :meth:`.Script.get_names()`.

:param follow_imports: The goto call will follow imports.
:param follow_builtin_imports: If follow_imports is True will try to
    look up names in builtins (i.e. compiled or extension modules).
:param only_stubs: Only return stubs for this goto call.
:param prefer_stubs: Prefer stubs to Python objects for this goto call.
:rtype: list of :class:`Name`
©rÓ   rÔ   )rU   rÃ   Úgotor   r   r)   rT   )rX   rÑ   rÒ   rÓ   rÔ   r"   r/   s          r   r×   ÚBaseName.goto¨  s‡   € ð  �z‰z×'×'ØˆIà—
‘
—‘Ó!ˆÞÜ)¨%ÓHˆEÜØØ!Ø%ñ
ˆñ ó Ú�Að ŸZ™Z›‘¬T°$×2GÑ2GÈÓ-KÒKÙñ ð 	 ùò  s   Á1Bzinfer on namerÖ   c                óŒ  • U(       a	  U(       a   eU R                   R                  (       d  / $ [        U R                   /SS9n[        [        R
                  " S U 5       5      UUS9nU Vs/ s H  oUR                  PM     nnU Vs/ s H*  nXpR                   :X  a  U O[        U R                  U5      PM,     sn$ s  snf s  snf )a‚  
Like :meth:`.Script.infer`, it can be useful to understand which type
the current name has.

Return the actual definitions. I strongly recommend not using it for
your completions, because it might slow down |jedi|. If you want to
read only a few objects (<=20), it might be useful, especially to get
the original docstrings. The basic problem of this function is that it
follows all results. This means with 1000 completions (e.g.  numpy),
it's just very, very slow.

:param only_stubs: Only return stubs for this goto call.
:param prefer_stubs: Prefer stubs to Python objects for this type
    inference call.
:rtype: list of :class:`Name`
T©rÔ   c              3   ó@   #   • U  H  oR                  5       v •  M     g 7fr2   )rr   )rN   r/   s     r   rQ   Ú!BaseName.infer.<locals>.<genexpr>â  s   é € Ð8²%¨QŸw™wŸy˜y²%ùr~   rÖ   )	rU   rÃ   r   r   r   Ú	from_setsr.   r)   rT   )rX   rÓ   rÔ   r"   r(   r3   Úresulting_namesr/   s           r   rr   ÚBaseName.inferÆ  sµ   € ö$ ¦<Ð0Ð0à�z‰z×'×'ØˆIô
 ˜tŸz™z˜l¸Ñ>ˆÜÜ×ÒÑ8±%Ó8Ó8Ø!Ø%ñ
ˆñ
 ,2Ó2ª6 aŸ6œ6©6ˆÐ2á(ó*Ú(�Að ŸZ™Z›‘¬T°$×2GÑ2GÈÓ-KÒKÙ(ñ*ð 	*ùò 3ùò*s   Á-B<Â1Cc                 ó  • U R                   R                  (       d  gU R                  S;   a|  U R                   R                  be  U R                   R                  R	                  5       nUR                  SSS5      nU R                  5       R                  U5      R                  5       nOU R                   R                  nUc  gUR                  c  UR                  nUR                  c  M  [        U R                  UR                  5      $ )z<
Returns the parent scope of this identifier.

:rtype: Name
N)r’   r“   r³   ÚfuncdefÚclassdefÚ
file_input)rU   rÃ   rp   rn   ro   Úsearch_ancestorr^   Úcreate_valuer%   Úparent_contextr.   r)   rT   )rX   Úcls_or_func_noderÎ   r,   s       r   rÎ   ÚBaseName.parentê  sÒ   € ð �z‰z×'×'Øà�9‰9Ð6Ó6¸4¿:¹:×;OÑ;OÑ;[ð  $Ÿz™z×3Ñ3×BÑBÓDÐØ%×5Ñ5°iÀÈ\ÓZˆFØ×.Ñ.Ó0×=Ñ=¸fÓE×PÑPÓR‰Gà—j‘j×/Ñ/ˆGà‰?ØØ�l‰lÑ"à×,Ñ,ˆGð �l‰lÓ"ô �D×)Ñ)¨7¯<©<Ó8Ð8r   c           	      óÄ   • SU R                   R                  < SU R                  (       a  SOS< SU R                  =(       d    U R                  < SU R                  < S3	$ )NÚ<r´   Úfull_rœ   zname=z, description=Ú>)Ú	__class__Ú__name__rÈ   r.   r¿   r]   s    r   Ú__repr__ÚBaseName.__repr__  sC   � à�N‰N×#Ô#Ø—~—~‰G¨2Ò-Ø�N‰N×'˜dŸi™iÒ'Ø×Ôð	
ð 	
r   c                 ó  • U R                   R                  (       d  gU R                   R                  5       R                  nUc  gU R                   R                  S   S-
  n[        XA-
  S5      nSR                  X5XB-   S-    5      $ )a  
Returns the line of code where this object was defined.

:param before: Add n lines before the current line to the output.
:param after: Add n lines after the current line to the output.

:return str: Returns the line(s) of code or an empty string if it's a
             builtin.
rœ   r   r‹   )rU   rÃ   r\   Ú
code_linesr   Úmaxr¯   )rX   ÚbeforeÚafterÚlinesÚindexÚstart_indexs         r   Úget_line_codeÚBaseName.get_line_code  sv   € ð �z‰z×'×'Øà—
‘
×+Ñ+Ó-×8Ñ8ˆØ‰=àà—
‘
×$Ñ$ QÑ'¨!Ñ+ˆÜ˜%™.¨!Ó,ˆØ�w‰w�u¨©¸Ñ):Ð;Ó<Ð<r   c                 óà  • U R                   R                  S:X  a  / $ U(       a1  U R                   R                  S:X  a  U R                  5       (       d  / $ [        U R                   [        5      (       a(  U R                   R                  5       R                  5       $ [        U R                   /SS9nU VVs/ s H)  o3R                  5       R                  5         H  oDPM     M+     snn$ s  snnf )NÚpropertyÚ	statementTrÚ   )	rU   rs   rb   rV   r	   Úinfer_compiled_valueÚget_signaturesr   rr   )rX   r®   r"   r.   Úsigs        r   r°   ÚBaseName._get_signatures)  s­   € Ø�:‰:×Ñ *Ó,ØˆIÞ˜TŸZ™Z×0Ñ0°KÓ?ÈÏÉÏÉð ˆIä�d—j‘j¤)×,Ñ,ð —:‘:×2Ñ2Ó4×CÑCÓEÐEä˜tŸz™z˜l¸Ñ>ˆÙ %ÔO¢˜·±³×1LÑ1L×1N¨#’Ñ1N‘¡ÒOÐOùÓOs   Â60C*c                 óv   • U R                  5        Vs/ s H  n[        U R                  U5      PM     sn$ s  snf )z±
Returns all potential signatures for a function or a class. Multiple
signatures are typical if you use Python stubs with ``@overload``.

:rtype: list of :class:`BaseSignature`
)r°   ÚBaseSignaturerT   )rX   r   s     r   rÿ   ÚBaseName.get_signatures:  s?   € ð ×)Ñ)Ô+ó
â+�ô ˜$×/Ñ/°Ö3Ù+ñ
ð 	
ùò 
s   “ 6c                 ód   • [        U R                  R                  5       R                  5       5      $ )zs
Uses type inference to "execute" this identifier and returns the
executed objects.

:rtype: list of :class:`Name`
)r4   rU   rr   Úexecute_with_valuesr]   s    r   ÚexecuteÚBaseName.executeF  s%   € ô & d§j¡j×&6Ñ&6Ó&8×&LÑ&LÓ&NÓOÐOr   c                 óR   • U R                   R                  5       R                  5       $ )zú
Returns type hints like ``Iterable[int]`` or ``Union[int, str]``.

This method might be quite slow, especially for functions. The problem
is finding executions for those functions to return something like
``Callable[[int, str], str]``.

:rtype: str
)rU   rr   Úget_type_hintr]   s    r   r
  ÚBaseName.get_type_hintO  s    € ð �z‰z×ÑÓ!×/Ñ/Ó1Ð1r   )rT   rU   rW   N©FTr   )F)+rî   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rÆ   ÚdictÚitemsÚ_tuple_mappingrY   r   r^   rü   r   r   rg   r.   rp   ry   r‚   r‡   rŒ   r�   r™   r£   r�   rž   r¿   rÈ   rb   rÏ   r   Úincrease_indent_cmr×   rr   rÎ   rï   rù   r°   rÿ   r  r
  Ú__static_attributes__© r   r   r6   r6   :   sÊ  † ñð ØØØØØ ØØØ!Ø%ØØñ€Hñ ñ Ø$Ð&?ðBç�eƒgðBó ó €Nò>ð ñ-ó ð-ð ð˜X d™^ó ó ðð ñ,ó ð,ð ñD#ó ðD#ðL ñ7ó ð7ò#ð ñó ðð ñó ðò$ò"ô&)(òV&ò
ð ñ.ó ð.ð` ñ$ó ð$òL7òPð ×Ò˜nÓ-Ø%*À5Ø¨Eô ó .ð ð: ×Ò˜oÓ.Ø"'°eô !*ó /ð!*òF9òB
ô=ô,Pò"

òPõ
2r   r6   c                   ó®   ^ • \ rS rSrSr SU 4S jjrS r\S 5       r\S 5       r	SU 4S jjr
U 4S jrU 4S	 jrU 4S
 jr\U 4S j5       rS rS rSrU =r$ )Ú
Completioni\  z|
``Completion`` objects are returned from :meth:`.Script.complete`. They
provide additional information about a completion.
c                 ób   >• [         TU ]  X5        X@l        X0l        XPl        X`l        / U l        g r2   )ÚsuperrY   Ú_like_name_lengthÚ_stackÚ	_is_fuzzyÚ_cached_nameÚ_same_name_completions)rX   r*   r.   ÚstackÚlike_name_lengthÚis_fuzzyÚcached_namerí   s          €r   rY   ÚCompletion.__init__a  s0   ø€ ä‰Ñ˜Ô/à!1ÔØŒØ!ŒØ'Ôð ')ˆÕ#r   c                 óº   • Sn[         R                  (       a  U R                  S:X  a  SnU R                  R	                  5       nU(       a  X0R
                  S  nX2-   $ )Nrœ   r’   Ú()r   Úadd_bracket_after_functionrp   rU   rj   r  )rX   Ú	like_nameÚappendr.   s       r   Ú	_completeÚCompletion._completen  sO   € ØˆÜ×.×.Ø—I‘I Ó+ØˆFà�z‰z×)Ñ)Ó+ˆÞØ×.Ñ.Ð/Ð0ˆDØ‰}Ðr   c                 óH   • U R                   (       a  gU R                  S5      $ )aÁ  
Only works with non-fuzzy completions. Returns None if fuzzy
completions are used.

Return the rest of the word, e.g. completing ``isinstance``::

    isinstan# <-- Cursor is here

would return the string 'ce'. It also adds additional stuff, depending
on your ``settings.py``.

Assuming the following function definition::

    def foo(param=0):
        pass

completing ``foo(par`` would give a ``Completion`` which ``complete``
would be ``am=``.
NT)r  r*  r]   s    r   ÚcompleteÚCompletion.completey  s   € ð* �>�>ØØ�~‰~˜dÓ#Ð#r   c                 ó$   • U R                  S5      $ )a
  
Similar to :attr:`.name`, but like :attr:`.name` returns also the
symbols, for example assuming the following function definition::

    def foo(param=0):
        pass

completing ``foo(`` would give a ``Completion`` which
``name_with_symbols`` would be "param=".

F)r*  r]   s    r   Úname_with_symbolsÚCompletion.name_with_symbols’  s   € ð �~‰~˜eÓ$Ð$r   c                 óB   >• U R                   S:¼  a  Sn[        TU ]	  XS9$ )z.
Documented under :meth:`BaseName.docstring`.
é   F)rŸ   r    )r  r  r£   )rX   rŸ   r    rí   s      €r   r£   ÚCompletion.docstring¡  s-   ø€ ð ×!Ñ! QÓ&ð ˆDä‰wÑ  SÐ Ð4Ð4r   c                 ó¸   >^ • T R                   b>  [        R                  " T R                   T R                  R	                  5       U 4S j5      $ [
        TT ]  5       $ )Nc                  ó$   >• T R                  5       $ r2   ©Ú
_get_cacher]   s   €r   r   Ú+Completion._get_docstring.<locals>.<lambda>±  ó   ø€ ˜Ÿ™Ô)r   )r  r   Úget_docstringrU   rj   r  r�   ©rX   rí   s   `€r   r�   ÚCompletion._get_docstring¬  sN   ù€ Ø×ÑÑ(Ü#×1Ò1Ø×!Ñ!Ø—
‘
×*Ñ*Ó,Ü)óð ô
 ‰wÑ%Ó'Ð'r   c                 ó¸   >^ • T R                   b>  [        R                  " T R                   T R                  R	                  5       U 4S j5      $ [
        TT ]  5       $ )Nc                  ó$   >• T R                  5       $ r2   r7  r]   s   €r   r   Ú5Completion._get_docstring_signature.<locals>.<lambda>º  r:  r   )r  r   Úget_docstring_signaturerU   rj   r  rž   r<  s   `€r   rž   Ú#Completion._get_docstring_signatureµ  sN   ù€ Ø×ÑÑ(Ü#×;Ò;Ø×!Ñ!Ø—
‘
×*Ñ*Ó,Ü)óð ô
 ‰wÑ/Ó1Ð1r   c                 óN   >• [         TU ]  [         TU ]	  5       [         TU ]  5       4$ r2   )r  rp   rž   r�   r<  s    €r   r8  ÚCompletion._get_cache¾  s*   ø€ ä‰G‰LÜ‰GÑ,Ó.Ü‰GÑ"Ó$ð
ð 	
r   c                 ó°   >^ • T R                   b>  [        R                  " T R                   T R                  R	                  5       U 4S j5      $ [
        TT ]  $ )z)
Documented under :meth:`BaseName.type`.
c                  ó$   >• T R                  5       $ r2   r7  r]   s   €r   r   Ú!Completion.type.<locals>.<lambda>Ï  r:  r   )r  r   Úget_typerU   rj   r  rp   r<  s   `€r   rp   ÚCompletion.typeÅ  sL   ù€ ð ×ÑÑ(Ü#×,Ò,Ø×!Ñ!Ø—
‘
×*Ñ*Ó,Ü)óð ô ‰w‰|Ðr   c                 ó   • U R                   $ )a'  
Returns the length of the prefix being completed.
For example, completing ``isinstance``::

    isinstan# <-- Cursor is here

would return 8, because len('isinstan') == 8.

Assuming the following function definition::

    def foo(param=0):
        pass

completing ``foo(par`` would return 3.
)r  r]   s    r   Úget_completion_prefix_lengthÚ'Completion.get_completion_prefix_lengthÔ  s   € ð  ×%Ñ%Ð%r   c                 ón   • S[        U 5      R                  < SU R                  R                  5       < S3$ )Nrê   z: rì   )rp   rî   rU   rj   r]   s    r   rï   ÚCompletion.__repr__æ  s$   � Ü! $›Z×0Ô0°$·*±*×2LÑ2LÖ2NÐOÐOr   )r  r  r  r  r  r2   r  )rî   r  r  r  r  rY   r*  rü   r-  r0  r£   r�   rž   r8  rp   rK  rï   r  Ú__classcell__©rí   s   @r   r  r  \  sx   ø† ñð
 (,÷)ò	ð ñ$ó ð$ð0 ñ%ó ð%÷	5õ(õ2õ
ð ôó ðò&÷$Pð Pr   r  c                   óT   ^ • \ rS rSrSrU 4S jr\S 5       rS rS r	S r
S rS	rU =r$ )
r)   iê  zo
*Name* objects are returned from many different APIs including
:meth:`.Script.goto` or :meth:`.Script.infer`.
c                 ó$   >• [         TU ]  X5        g r2   )r  rY   )rX   r*   ru   rí   s      €r   rY   ÚName.__init__ï  s   ø€ Ü‰Ñ˜Õ5r   c                 ót   ^ • T R                   R                  5       n[        [        U 4S jU 5       5      S S9$ )zO
List sub-definitions (e.g., methods in class).

:rtype: list of :class:`Name`
c              3   óP   >#   • U  H  n[        TR                  U5      v •  M     g 7fr2   )r0   rT   )rN   ÚdrX   s     €r   rQ   Ú%Name.defined_names.<locals>.<genexpr>û  s!   øé € ÐHÂ4¸a”- × 5Ñ 5°q×9Ð9Â4ùs   ƒ#&c                 ó@   • U R                   R                  =(       d    S$ r   r…   r   s    r   r   Ú$Name.defined_names.<locals>.<lambda>ü  s   € ˜!Ÿ'™'×+Ñ+×5¨vÐ5r   r   )rU   rr   r!   r   )rX   Údefss   ` r   r0   ÚName.defined_namesò  s5   ø€ ð �z‰z×ÑÓ!ˆÜÜÔHÁ4ÓHÓHÙ5ñ
ð 	
r   c                 óz   • U R                   R                  c  gU R                   R                  R                  5       $ )z€
Returns True, if defined as a name in a statement, function or class.
Returns False, if it's a reference to such a definition.
T)rU   rn   rq   r]   s    r   rq   ÚName.is_definitionÿ  s0   € ð
 �:‰:×ÑÑ'Øà—:‘:×'Ñ'×5Ñ5Ó7Ð7r   c                 ó  • U R                   R                  UR                   R                  :H  =(       aY    U R                  UR                  :H  =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ r2   )rU   r   rg   r.   rT   ©rX   Úothers     r   Ú__eq__ÚName.__eq__	  sp   € Ø�z‰z×#Ñ# u§{¡{×'<Ñ'<Ñ<÷ @Ø× Ñ  E×$5Ñ$5Ñ5÷@à—	‘	˜UŸZ™ZÑ'÷@ð ×%Ñ%¨×)?Ñ)?Ñ?ð	@r   c                 ó.   • U R                  U5      (       + $ r2   )ra  r_  s     r   Ú__ne__ÚName.__ne__  s   € Ø—;‘;˜uÓ%Ô%Ð%r   c                 ó„   • [        U R                  R                  U R                  U R                  U R
                  45      $ r2   )ÚhashrU   r   rg   r.   rT   r]   s    r   Ú__hash__ÚName.__hash__  s0   € Ü�T—Z‘Z×)Ñ)¨4×+;Ñ+;¸T¿Y¹YÈ×H]ÑH]Ð^Ó_Ð_r   r  )rî   r  r  r  r  rY   r   r0   rq   ra  rd  rh  r  rO  rP  s   @r   r)   r)   ê  s=   ø† ñõ6ð ñ

ó ð

ò8ò@ò&÷`ð `r   r)   c                   óB   ^ • \ rS rSrSrU 4S jr\S 5       rS rSr	U =r
$ )r  i  zI
These signatures are returned by :meth:`BaseName.get_signatures`
calls.
c                 óD   >• [         TU ]  XR                  5        X l        g r2   )r  rY   r.   Ú
_signature)rX   r*   r¬   rí   s      €r   rY   ÚBaseSignature.__init__  s   ø€ Ü‰Ñ˜¯.©.Ô9Ø#�r   c                 óˆ   • U R                   R                  SS9 Vs/ s H  n[        U R                  U5      PM     sn$ s  snf )zœ
Returns definitions for all parameters that a signature defines.
This includes stuff like ``*args`` and ``**kwargs``.

:rtype: list of :class:`.ParamName`
T©Úresolve_stars)rl  Úget_param_namesÚ	ParamNamerT   )rX   r/   s     r   ÚparamsÚBaseSignature.params  sL   € ð Ÿ™×8Ñ8ÀtÐ8ÑLóNÚL�Aô ˜$×/Ñ/°Ö3ÙLñNð 	Nùò Ns   œ ?c                 ó6   • U R                   R                  5       $ )z�
Returns a text representation of the signature. This could for example
look like ``foo(bar, baz: int, **kwargs)``.

:rtype: str
)rl  r«   r]   s    r   r«   ÚBaseSignature.to_string*  s   € ð �‰×(Ñ(Ó*Ð*r   )rl  )rî   r  r  r  r  rY   rü   rs  r«   r  rO  rP  s   @r   r  r    s-   ø† ñõ$ð ñNó ðN÷+ð +r   r  c                   óR   ^ • \ rS rSrSrU 4S jr\S 5       r\S 5       rS r	Sr
U =r$ )Ú	Signaturei4  zP
A full signature object is the return value of
:meth:`.Script.get_signatures`.
c                 ó<   >• [         TU ]  X5        X0l        X l        g r2   )r  rY   Ú_call_detailsrl  )rX   r*   r¬   Úcall_detailsrí   s       €r   rY   ÚSignature.__init__9  s   ø€ Ü‰Ñ˜Ô4Ø)ÔØ#�r   c                 óf   • U R                   R                  U R                  R                  SS95      $ )z„
Returns the param index of the current cursor position.
Returns None if the index cannot be found in the curent call.

:rtype: int
Tro  )rz  Úcalculate_indexrl  rq  r]   s    r   r÷   ÚSignature.index>  s2   € ð ×!Ñ!×1Ñ1Ø�O‰O×+Ñ+¸$Ð+Ð?ó
ð 	
r   c                 óB   • U R                   R                  R                  $ )zš
Returns a line/column tuple of the bracket that is responsible for the
last function call. The first line is 1 and the first column 0.

:rtype: int, int
)rz  Úbracket_leafr   r]   s    r   Úbracket_startÚSignature.bracket_startJ  s   € ð ×!Ñ!×.Ñ.×8Ñ8Ð8r   c                 óŠ   • S[        U 5      R                  < SU R                  < SU R                  R	                  5       < S3$ )Nrê   z: index=r´   rì   )rp   rî   r÷   rl  r«   r]   s    r   rï   ÚSignature.__repr__T  s0   � ä�‹J×ÔØ�JŒJØ�O‰O×%Ñ%Ö'ð
ð 	
r   )rz  rl  )rî   r  r  r  r  rY   rü   r÷   r‚  rï   r  rO  rP  s   @r   rx  rx  4  s?   ø† ñõ$ð
 ñ	
ó ð	
ð ñ9ó ð9÷
ð 
r   rx  c                   ó6   • \ rS rSrS rS rS r\S 5       rSr	g)rr  i\  c                 óH   • [        U R                  R                  5       5      $ )z]
Returns default values like the ``1`` of ``def foo(x=1):``.

:rtype: list of :class:`.Name`
)r4   rU   Úinfer_defaultr]   s    r   rˆ  ÚParamName.infer_default]  s   € ô & d§j¡j×&>Ñ&>Ó&@ÓAÐAr   c                 óP   • [        U R                  R                  " SSS0UD65      $ )zž
:param execute_annotation: Default True; If False, values are not
    executed and classes are returned instead of instances.
:rtype: list of :class:`.Name`
Úignore_starsTr  )r4   rU   Úinfer_annotation)rX   Úkwargss     r   rŒ  ÚParamName.infer_annotatione  s'   € ô & d§j¡j×&AÒ&AÑ&^ÈtÐ&^ÐW]Ñ&^Ó_Ð_r   c                 ó6   • U R                   R                  5       $ )zZ
Returns a simple representation of a param, like
``f: Callable[..., Any]``.

:rtype: str
)rU   r«   r]   s    r   r«   ÚParamName.to_stringm  s   € ð �z‰z×#Ñ#Ó%Ð%r   c                 ó6   • U R                   R                  5       $ )zm
Returns an enum instance of :mod:`inspect`'s ``Parameter`` enum.

:rtype: :py:attr:`inspect.Parameter.kind`
)rU   Úget_kindr]   s    r   ÚkindÚParamName.kindv  s   € ð �z‰z×"Ñ"Ó$Ð$r   r  N)
rî   r  r  r  rˆ  rŒ  r«   rü   r“  r  r  r   r   rr  rr  \  s'   † òBò`ò&ð ñ%ó ó%r   rr  ))r  rº   Úpathlibr   Útypingr   Újedir   r   Újedi.inference.utilsr   Ú
jedi.cacher   Újedi.inference.compiled.mixedr	   Újedi.inference.namesr
   r   Ú!jedi.inference.gradual.stub_valuer   Ú!jedi.inference.gradual.conversionr   r   Újedi.inference.base_valuer   r   Újedi.api.keywordsr   Újedi.apir   Újedi.api.helpersr   r#   r0   r4   r6   r  r)   r  rx  rr  r  r   r   Ú<module>r¢     s›   ðñó 
Ý Ý å Ý Ý &Ý %Ý 3ß :Ý =ß Kß <Ý )Ý %Ý 2ò>òOò =÷_2ñ _2ôDKP�ô KPô\)`ˆ8ô )`ôX+�Dô +ô<%
�ô %
ôP!%�õ !%r   