Format: application/x-python-code
⬇ Download File (26.3 KB)
   1  o
   2  
   3  �h�~�@s�dZddlZddlmZddlZddlmZddlmZddl	m
   4  Z
   5  ddl	mZddl	mZdd	l
   6  mZdd
   7  lmZddlmZddlmZdd
   8  lmZddlmZmZddlmZddlmZddlmZmZddlm Z ddlm!Z!ddl"m#Z#m$Z$ddl%m&Z&ddl%m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9m:Z:dd l;m<Z<dd!l=m>Z>e�?d"�Gd#d$�d$�Z@Gd%d&�d&e@�ZAd'd(�ZBe
   9  jCd)d)d)fd*d+�ZDdS),aQ
  10  The API basically only provides one class. You can create a :class:`Script` and
  11  use its methods.
  12  
  13  Additionally you can add a debug function with :func:`set_debug_function`.
  14  Alternatively, if you don't need a custom function and are happy with printing
  15  debug messages to stdout, simply call :func:`set_debug_function` without
  16  arguments.
  17  �N)�Path)�tree)�get_executable_nodes)�debug)�settings)�cache)�KnownContentFileIO)�classes)�interpreter)�helpers)�validate_line_column)�
  18  Completion�search_in_module)�KeywordName)�InterpreterEnvironment)�get_default_project�Project)�parso_to_jedi_errors)�refactoring)�extract_function�extract_variable)�InferenceState)�imports)�find_references)�try_iter_content)�infer_call_of_leaf)�transform_path_to_dotted)�tree_name_to_values)�ModuleValue)�ValueSet)�unpack_tuple_to_dict)�
  19  convert_names�convert_values)�load_proper_stub_module)�to_listi�c@s@eZdZdZd7dddd�dd�Zejdd��Zdd	�Zd
  20  d�Z	e
  21  d8dd
  22  �dd��Ze
  23  d8ddd�dd��Ze
  24  d8ddddd�dd��Z
  25  dd�dd�Zed9dd��Zdd�Ze
  26  d8dd��Ze
  27  d8dd ��Ze
  28  d8d!d"��Ze
  29  d8d#d$��Zd%d&�Zd'd(�Zd)d*�Zd:d,d-�Zd8d.d/�Ze
  30  ddd0�d1d2��Ze
  31  ddd0�d3d4��Zd8d5d6�ZdS);�ScriptaK
  32  
  33      A Script is the base for completions, goto or whatever you want to do with
  34      Jedi. The counter part of this class is :class:`Interpreter`, which works
  35      with actual dictionaries and can work with a REPL. This class
  36      should be used when a user edits code in an editor.
  37  
  38      You can either use the ``code`` parameter or ``path`` to read a file.
  39      Usually you're going to want to use both of them (in an editor).
  40  
  41      The Script's ``sys.path`` is very customizable:
  42  
  43      - If `project` is provided with a ``sys_path``, that is going to be used.
  44      - If `environment` is provided, its ``sys.path`` will be used
  45        (see :func:`Environment.get_sys_path <jedi.api.environment.Environment.get_sys_path>`);
  46      - Otherwise ``sys.path`` will match that of the default environment of
  47        Jedi, which typically matches the sys path that was used at the time
  48        when Jedi was imported.
  49  
  50      Most methods have a ``line`` and a ``column`` parameter. Lines in Jedi are
  51      always 1-based and columns are always zero based. To avoid repetition they
  52      are not always documented. You can omit both line and column. Jedi will
  53      then just do whatever action you are calling at the end of the file. If you
  54      provide only the line, just will complete at the end of that line.
  55  
  56      .. warning:: By default :attr:`jedi.settings.fast_parser` is enabled, which means
  57          that parso reuses modules (i.e. they are not immutable). With this setting
  58          Jedi is **not thread safe** and it is also not safe to use multiple
  59          :class:`.Script` instances and its definitions at the same time.
  60  
  61          If you are a normal plugin developer this should not be an issue. It is
  62          an issue for people that do more complex stuff with Jedi.
  63  
  64          This is purely a performance optimization and works pretty well for all
  65          typical usages, however consider to turn the setting off if it causes
  66          you problems. See also
  67          `this discussion <https://github.com/davidhalter/jedi/issues/1240>`_.
  68  
  69      :param code: The source code of the current file, separated by newlines.
  70      :type code: str
  71      :param path: The path of the file in the file system, or ``''`` if
  72          it hasn't been saved yet.
  73      :type path: str or pathlib.Path or None
  74      :param Environment environment: Provide a predefined :ref:`Environment <environments>`
  75          to work with a specific Python version or virtualenv.
  76      :param Project project: Provide a :class:`.Project` to make sure finding
  77          references works well, because the right folder is searched. There are
  78          also ways to modify the sys path and other things.
  79      N)�path�environment�projectcCs||_t|t�rt|�}|r|��nd|_|dur:|dur!td��t|d��}|��}Wd�n1s5wY|durKt	|jdurFdn|jj
  80  �}t|||jd�|_t
  81  �d�|jj||j|oe|jdkdtjtjd�\|_}t
  82  �d�tj|d	d
  83  �|_||_t��t
  84  ��dS)Nz)Must provide at least one of code or path�rb)r'Zscript_path�init�.pyiF)�coder&Zuse_latest_grammarrZ
  85  diff_cache�
  86  cache_path�parsedT)�keepends)�
  87  _orig_path�
  88  isinstance�strr�absoluter&�
  89  ValueError�open�readr�parentr�_inference_stater�speedZparse_and_get_code�suffixrZfast_parserZcache_directory�_module_node�parso�split_lines�_code_lines�_coderZclear_time_cachesZ
  90  reset_time)�selfr,r&r'r(�f�rB�Gc:\Users\shubh\Videos\agent\nova\Lib\site-packages\jedi/api/__init__.py�__init__ds:
  91  
  92  ��
  93  �
  94  zScript.__init__cCs�d}d}|jdurt|jjdd�|j�\}}|dur|}|}|jdur&d}nt|j|j�}|jdurJ|jjdkrJt|j|jj|||j	�}|durJ|S|durPd}t
  95  |j|j	|||j|d�}|ddvrn|jj�
  96  |t|g��|S)NF)Zadd_parent_pathsr+��__main__)�file_io�string_names�
  97  code_lines�
  98  is_packager)�builtins�typing)r&rr8Zget_sys_pathrr?r:r#Zlatest_grammarr;rr>Zmodule_cache�addr)r@�namesrJ�import_namesZis_prGZstub_module�modulerBrBrC�_get_module�sF
  99  �
 100  ��zScript._get_modulecCs|����S�N)rQ�
 101  as_context�r@rBrBrC�_get_module_context�szScript._get_module_contextcCsd|jjt|j�|jjfS)Nz<%s: %s %r>)�	__class__�__name__�reprr0r8r'rTrBrBrC�__repr__�s
 102  �zScript.__repr__F��fuzzyc	Csb|j��t�d��t|j|��|j||f|j|d�}|��Wd�S1s*wYdS)a+
 103          Completes objects under the cursor.
 104  
 105          Those objects contain information about the completions, more than just
 106          names.
 107  
 108          :param fuzzy: Default False. Will return fuzzy completions, which means
 109              that e.g. ``ooa`` will match ``foobar``.
 110          :return: Completion objects, sorted by name. Normal names appear
 111              before "private" names that start with ``_`` and those appear
 112              before magic methods and name mangled names that start with ``__``.
 113          :rtype: list of :class:`.Completion`
 114          �completerZN)	r8�reset_recursion_limitationsrZincrease_indent_cmr
 115  rUr>�get_signaturesr\)r@�line�columnr[�
 116  completionrBrBrCr\�s
 117  �$�zScript.complete��
 118  only_stubs�prefer_stubscs��j��||f}�j�|�}|durA�j�|�}|dus"|jdkr$gS|j||fkrA|jdkrA|��}|j|jkrA|jdvrA|}��	��
 119  |�}t��j||�}	t
 120  |	||d�}	�fdd�|	D�}
 121  t�t|
 122  ��S)a�
 123          Return the definitions of under the cursor. It is basically a wrapper
 124          around Jedi's type inference.
 125  
 126          This method follows complicated paths and returns the end, not the
 127          first definition. The big difference between :meth:`goto` and
 128          :meth:`infer` is that :meth:`goto` doesn't
 129          follow imports and statements. Multiple objects may be returned,
 130          because depending on an option you can have two different versions of a
 131          function.
 132  
 133          :param only_stubs: Only return stubs for this method.
 134          :param prefer_stubs: Prefer stubs to Python objects for this method.
 135          :rtype: list of :class:`.Name`
 136          N�string�operator)�numberre�keywordrbcsg|]
 137  }t��j|j��qSrB)r	�Namer8�name)�.0�crTrBrC�
 138  <listcomp>�z Script.infer.<locals>.<listcomp>)r8r]r;�get_name_of_position�get_leaf_for_position�type�end_pos�
 139  get_next_leaf�	start_posrU�create_contextr�inferr"�sorted_definitions�set)r@r_r`rcrd�pos�leaf�next_�context�values�defsrBrTrCrv�s*
 140  
 141  �zScript.infer)�follow_imports�follow_builtin_importsrcrdcs��j���j�||f�}|dur�j||||d�S����|�}g}	|j��rO|j	�
 142  �rO|j	j}
 143  ����|
 144  �}|�
 145  �}t|�|D]}
 146  |
 147  �|j�}	|	rNnqB|	sWt|���}	|r_t�|	|�}	t|	||d�}	�fdd�t|	�D�}ttt�|���S)a~
 148          Goes to the name that defined the object under the cursor. Optionally
 149          you can follow imports.
 150          Multiple objects may be returned, depending on an if you can have two
 151          different versions of a function.
 152  
 153          :param follow_imports: The method will follow imports.
 154          :param follow_builtin_imports: If ``follow_imports`` is True will try
 155              to look up names in builtins (i.e. compiled or extension modules).
 156          :param only_stubs: Only return stubs for this method.
 157          :param prefer_stubs: Prefer stubs to Python objects for this method.
 158          :rtype: list of :class:`.Name`
 159          Nrbc�g|]	}t��j|��qSrB�r	rir8�rk�drTrBrCrm6�zScript.goto.<locals>.<listcomp>)r8r]r;rorvrU�create_name�	tree_nameZ
 160  is_definition�parent_context�is_classZ	tree_node�create_valueZ	py__mro__�next�goto�value�listrZfilter_follow_importsr!rxrw)r@r_r`rr�rcrdr�rjrNZ
 161  class_nodeZclass_value�mro�clsr~rBrTrCr�s6
 162  ��zScript.goto��
 163  all_scopescCs|j||d�S)a�
 164          Searches a name in the current file. For a description of how the
 165          search string should look like, please have a look at
 166          :meth:`.Project.search`.
 167  
 168          :param bool all_scopes: Default False; searches not only for
 169              definitions on the top level of a module level, but also in
 170              functions and classes.
 171          :yields: :class:`.Name`
 172          r���_search_func)r@rer�rBrBrC�search:sz
 173  Script.searchc	Cs6|j|d�}t�|�\}}t|j|��|||||d�S)Nr�)rN�wanted_type�wanted_namesr\r[)�_namesrZsplit_search_stringrr8rU)r@rer�r\r[rNr�r�rBrBrCr�Gs�zScript._search_funccKs|j|fddi|��S)a
 174          Like :meth:`.Script.search`, but completes that string. If you want to
 175          have all possible definitions in a file you can also provide an empty
 176          string.
 177  
 178          :param bool all_scopes: Default False; searches not only for
 179              definitions on the top level of a module level, but also in
 180              functions and classes.
 181          :param fuzzy: Default False. Will return fuzzy completions, which means
 182              that e.g. ``ooa`` will match ``foobar``.
 183          :yields: :class:`.Completion`
 184          r\Tr�)r@re�kwargsrBrBrC�complete_searchUs
 185  zScript.complete_searchcs��j���j||dd�}|r|S�j�||f���dur9�j||fkr9�jdkr9���}|dur9|j�jkr9|��dur[�jdvr[��fdd�}|�r[t	�j�j
 186  �}t��j|�gSgS)a*
 187          Used to display a help window to users.  Uses :meth:`.Script.goto` and
 188          returns additional definitions for keywords and operators.
 189  
 190          Typically you will want to display :meth:`.BaseName.docstring` to the
 191          user for all the returned definitions.
 192  
 193          The additional definitions are ``Name(...).type == 'keyword'``.
 194          These definitions do not have a lot of value apart from their docstring
 195          attribute, which contains the output of Python's :func:`help` function.
 196  
 197          :rtype: list of :class:`.Name`
 198          T)rN�newline)rhrfZ
 199  error_leafcsH�jdvr�jjdkr
 200  dS�jjdkrdS�jj}|jj��}�j|vS)N)�(�)�[�]�trailerFZatom)r�r7rqr8�grammarZ
 201  _pgen_grammarZreserved_syntax_strings�keys)r��reserved�rzr@rBrC�
 202  need_pydocs
 203  
 204  zScript.help.<locals>.need_pydoc)
 205  r8r]r�r;rprrrqrsrtrr�r	ri)r@r_r`�definitionsr{r�rjrBr�rC�helpds
 206   zScript.helpcs*�j��d���fdd�	}|di|��S)a�
 207          Lists all references of a variable in a project. Since this can be
 208          quite hard to do for Jedi, if it is too complicated, Jedi will stop
 209          searching.
 210  
 211          :param include_builtins: Default ``True``. If ``False``, checks if a definition
 212              is a builtin (e.g. ``sys``) and in that case does not return it.
 213          :param scope: Default ``'project'``. If ``'file'``, include references in
 214              the current module only.
 215          :rtype: list of :class:`.Name`
 216          Tr(csv|dvrtd���j���f�}|durgSt���||dk�}�fdd�|D�}|r/|dkr6dd�|D�}t�|�S)N)r(�filez0Only the scopes "file" and "project" are allowedr�cr�rBr��rk�nrTrBrCrm�r�z>Script.get_references.<locals>._references.<locals>.<listcomp>cSsg|]}|��s|�qSrB)Zin_builtin_moduler�rBrBrCrm�s)r4r;rorrUrrw)�include_builtins�scoper�rNr��r`r_r@rBrC�_references�s
 217  z*Script.get_references.<locals>._referencesN)Tr(rB)r8r])r@r_r`r�r�rBr�rC�get_references�s
 218  
 219  zScript.get_referencescsv�j��||f}t��j|���durgS�����j�}t��j|�j�j	|�}t
 220  �d���fdd�|��D�S)aZ
 221          Return the function object of the call under the cursor.
 222  
 223          E.g. if the cursor is here::
 224  
 225              abs(# <-- cursor is here
 226  
 227          This would return the ``abs`` function. On the other hand::
 228  
 229              abs()# <-- cursor is here
 230  
 231          This would return an empty list..
 232  
 233          :rtype: list of :class:`.Signature`
 234          Nzfunc_call followedcsg|]
 235  }t��j|���qSrB)r	�	Signaturer8)rk�	signature�Zcall_detailsr@rBrCrm�s�z)Script.get_signatures.<locals>.<listcomp>)
 236  r8r]rZget_signature_detailsr;rUruZbracket_leafZcache_signaturesr>rr9r^)r@r_r`ryr|r�rBr�rCr^�s"
 237  �
 238  �zScript.get_signaturesc
 239  Cs||f}|jj|dd�}|j|ks|jdkr |��}|dur |}|��}t�|dd�}|durH|j|kr>|jdjkrHnn|�	|��
 240  �}n|�|�}|jdurZ|j
 241  }|jdusRt�|j|j�}	|	jdkr�|	j}
 242  |
 243  j}|dur|��}|jd	|kr	|	S|	��}	|	jdksg|	S)
 244  z�
 245          Returns the scope context under the cursor. This basically means the
 246          function, class or module where the cursor is at.
 247  
 248          :rtype: :class:`.Name`
 249          T)Zinclude_prefixesZ	endmarkerN�funcdef�classdef�����rP�)r;rprtrqZget_previous_leafrUrZsearch_ancestor�childrenr�rSrurjr�r	rir8�_namer�Zget_definitionr7)
 250  r@r_r`ryrzZ
 251  previous_leaf�module_contextr�r|Z
 252  definitionrjr�r�rBrBrC�get_context�s4*
 253  
 254  
 255  �
 256  �
 257  �zScript.get_contextc
 258  sVd�j_�jg�j_���}z�t�j�D]w}|�|�}|jdvr+t�j||j	d�n[t
 259  |tj�rTt
 260  |���}|��rH|t
 261  dd�|��D��O}|D]}t�||�qJn2|jdkrp|�|�}|j	ddd�D]}t|||�qfn|jd	kr}�j�||�}nt||�}t|��j��q�fd
 262  d��jjD�}	tt
 263  |	�dd
 264  �d�Wd�j_Sd�j_w)NT)r�r�r�css�|]}|dVqdS)r�NrB)rkr&rBrBrC�	<genexpr>s�z#Script._analysis.<locals>.<genexpr>Z	expr_stmtr��rjcsg|]
 265  }�j|jkr|�qSrB)r&)rk�arTrBrCrmrnz$Script._analysis.<locals>.<listcomp>cS�|jSrR)r_��xrBrBrC�<lambda>�z"Script._analysis.<locals>.<lambda>��keyF)r8Zis_analysisr;Zanalysis_modulesrUrrurqrr�r1r�ImportrxZget_defined_namesZ	is_nested�	get_pathsrZinfer_importZ
 266  infer_noder rvrrr]Zanalysis�sorted)
 267  r@rP�noder|rOr��typesZtestlistr~ZanarBrTrC�	_analysis�s8
 268  
 269  �
 270  
 271  �
 272  
 273  zScript._analysiscs"�jdi|��}�fdd�|D�S)a�
 274          Returns names defined in the current file.
 275  
 276          :param all_scopes: If True lists the names of all scopes instead of
 277              only the module namespace.
 278          :param definitions: If True lists the names that have been defined by a
 279              class, function or a statement (``a = b`` returns ``a``).
 280          :param references: If True lists all the names that are not listed by
 281              ``definitions=True``. E.g. ``a = b`` returns ``b``.
 282          :rtype: list of :class:`.Name`
 283          cr�rBr�r�rTrBrCrm-r�z$Script.get_names.<locals>.<listcomp>NrB)r�)r@r�rNrBrTrC�	get_names szScript.get_namescCst|jj|j�S)zm
 284          Lists all syntax errors in the current file.
 285  
 286          :rtype: list of :class:`.SyntaxError`
 287          )rr8r�r;rTrBrBrC�get_syntax_errors/szScript.get_syntax_errorsTcsD|j��|����fdd�tj|j|||d�D�}t|dd�d�S)Ncsg|]}��|��qSrB)r�)rkrj�r�rBrCrm;s��z!Script._names.<locals>.<listcomp>)r�r��
 288  referencescSr�rR)rtr�rBrBrCr�Dr�zScript._names.<locals>.<lambda>r�)r8r]rUrZget_module_namesr;r�)r@r�r�r�r~rBr�rCr�7s
 289  
 290  ��	z
 291  Script._namescCs |j||dd�}t�|j||�S)z�
 292          Renames all references of the variable under the cursor.
 293  
 294          :param new_name: The variable under the cursor will be renamed to this
 295              string.
 296          :raises: :exc:`.RefactoringError`
 297          :rtype: :class:`.Refactoring`
 298          F�r�)r�r�renamer8)r@r_r`�new_namer�rBrBrCr�Fs	z
 299  Script.rename)�
 300  until_line�until_columncCs`|dur|durd}n|dur|}|durt|j|d�}||f}t|j|j|j|||f|�S)a:
 301          Moves an expression to a new statement.
 302  
 303          For example if you have the cursor on ``foo`` and provide a
 304          ``new_name`` called ``bar``::
 305  
 306              foo = 3.1
 307              x = int(foo + 1)
 308  
 309          the code above will become::
 310  
 311              foo = 3.1
 312              bar = foo + 1
 313              x = int(bar)
 314  
 315          :param new_name: The expression under the cursor will be renamed to
 316              this string.
 317          :param int until_line: The the selection range ends at this line, when
 318              omitted, Jedi will be clever and try to define the range itself.
 319          :param int until_column: The the selection range ends at this column, when
 320              omitted, Jedi will be clever and try to define the range itself.
 321          :raises: :exc:`.RefactoringError`
 322          :rtype: :class:`.Refactoring`
 323          Nr�)�lenr>rr8r&r;�r@r_r`r�r�r�Z	until_posrBrBrCrRs
 324  �zScript.extract_variablecCsb|dur|durd}n|dur|}|durt|j|d�}||f}t|j|j|��|||f|�S)a�
 325          Moves an expression to a new function.
 326  
 327          For example if you have the cursor on ``foo`` and provide a
 328          ``new_name`` called ``bar``::
 329  
 330              global_var = 3
 331  
 332              def x():
 333                  foo = 3.1
 334                  x = int(foo + 1 + global_var)
 335  
 336          the code above will become::
 337  
 338              global_var = 3
 339  
 340              def bar(foo):
 341                  return int(foo + 1 + global_var)
 342  
 343              def x():
 344                  foo = 3.1
 345                  x = bar(foo)
 346  
 347          :param new_name: The expression under the cursor will be replaced with
 348              a function with this name.
 349          :param int until_line: The the selection range ends at this line, when
 350              omitted, Jedi will be clever and try to define the range itself.
 351          :param int until_column: The the selection range ends at this column, when
 352              omitted, Jedi will be clever and try to define the range itself.
 353          :raises: :exc:`.RefactoringError`
 354          :rtype: :class:`.Refactoring`
 355          Nr�)r�r>rr8r&rUr�rBrBrCrys"
 356  �zScript.extract_functioncCs(dd�|j||dd�D�}t�|j|�S)a�
 357          Inlines a variable under the cursor. This is basically the opposite of
 358          extracting a variable. For example with the cursor on bar::
 359  
 360              foo = 3.1
 361              bar = foo + 1
 362              x = int(bar)
 363  
 364          the code above will become::
 365  
 366              foo = 3.1
 367              x = int(foo + 1)
 368  
 369          :raises: :exc:`.RefactoringError`
 370          :rtype: :class:`.Refactoring`
 371          cSsg|]}|j�qSrB)r�r�rBrBrCrm�sz!Script.inline.<locals>.<listcomp>Tr�)r�r�inliner8)r@r_r`rNrBrBrCr��sz
 372  Script.inlinerR)NN)FFF)FTF)rW�
 373  __module__�__qualname__�__doc__rDr�memoize_methodrQrUrYrr\rvr�r�r$r�r�r�r�r^r�r�r�r�r�r�rrr�rBrBrBrCr%3sJ0(
 374  +,�3
 375  
 376  +%("
 377  
 378  &.r%cs4eZdZdZdd��fdd�
 379  Zejdd��Z�ZS)�Interpretera	
 380      Jedi's API for Python REPLs.
 381  
 382      Implements all of the methods that are present in :class:`.Script` as well.
 383  
 384      In addition to completions that normal REPL completion does like
 385      ``str.upper``, Jedi also supports code completion based on static code
 386      analysis. For example Jedi will complete ``str().upper``.
 387  
 388      >>> from os.path import join
 389      >>> namespace = locals()
 390      >>> script = Interpreter('join("").up', [namespace])
 391      >>> print(script.complete()[0].name)
 392      upper
 393  
 394      All keyword arguments are same as the arguments for :class:`.Script`.
 395  
 396      :param str code: Code to parse.
 397      :type namespaces: typing.List[dict]
 398      :param namespaces: A list of namespace dictionaries such as the one
 399          returned by :func:`globals` and :func:`locals`.
 400      N)r(cs�z	dd�|D�}Wntytd��w|�dd�}|dur#t�}n	t|t�s,td��|dur6tt���}t�j	|f||d�|��||_
 401  tj|j
 402  _d|j
 403  _dS)NcSsg|]}t|��qSrB)�dictr�rBrBrCrm�sz(Interpreter.__init__.<locals>.<listcomp>z-namespaces must be a non-empty list of dicts.r'z?The environment needs to be an InterpreterEnvironment subclass.)r'r(F)�	Exception�	TypeError�getrr1rr�cwd�superrD�
 404  namespacesrZ#allow_unsafe_interpreter_executionsr8Zallow_unsafe_executionsZdo_dynamic_params_search)r@r,r�r(�kwdsr'�rVrBrCrD�s"�
 405  �	zInterpreter.__init__cCsD|jdurd}nt|j|j�}t|j|j|d|jd�}t�||j	�S)NrE)rGrHrI)
 406  r&rr?rr8r;r>r
 407  ZMixedModuleContextr�)r@rGZtree_module_valuerBrBrCrU�s
 408  ��zInterpreter._get_module_context)	rWr�r�r�rDrr�rU�
 409  __classcell__rBrBr�rCr��s
 410  r�cGs*|D]}d|}t|��dt|��qdS)z�
 411      Preloading modules tells Jedi to load a module now, instead of lazy parsing
 412      of modules. This can be useful for IDEs, to control which modules to load
 413      on startup.
 414  
 415      :param modules: different module names, list of string.
 416      zimport %s as x; x.r�N)r%r\r�)�modules�m�srBrBrC�preload_modules�r�TcCs|t_|t_|t_|t_dS)z�
 417      Define a callback debug function to get all the debug messages.
 418  
 419      If you don't specify any arguments, debug messages will be printed to stdout.
 420  
 421      :param func_cb: The callback function for debug messages.
 422      N)rZdebug_functionZenable_warningZ
 423  enable_noticeZenable_speed)Zfunc_cb�warningsZnoticesr9rBrBrC�set_debug_functions	
 424  r�)Er��sys�pathlibrr<Zparso.pythonrZjedi.parser_utilsrZjedirrrZjedi.file_iorZjedi.apir	r
 425  rZjedi.api.helpersrZjedi.api.completionr
 426  rZjedi.api.keywordsrZjedi.api.environmentrZjedi.api.projectrrZjedi.api.errorsrrZjedi.api.refactoring.extractrrZjedi.inferencerrZjedi.inference.referencesrZjedi.inference.argumentsrZjedi.inference.helpersrZjedi.inference.sys_pathrZjedi.inference.syntax_treerZjedi.inference.valuerZjedi.inference.base_valuerZjedi.inference.value.iterabler Z!jedi.inference.gradual.conversionr!r"Zjedi.inference.gradual.utilsr#Zjedi.inference.utilsr$�setrecursionlimitr%r�r�Zprint_to_stdoutr�rBrBrBrC�<module>s\	
 427  H
 428  �