id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
176,471
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
Returns the possible node names (e.g. import_from, xor_test or yield_stmt).
176,472
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
null
176,473
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
null
176,474
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
Returns the amount of commas and the keyword argument string.
176,475
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
null
176,476
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
This function calculates the cache key.
176,477
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
null
176,478
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
Returns a dictionary with name parts as keys and their call paths as values.
176,479
import re from collections import namedtuple from textwrap import dedent from itertools import chain from functools import wraps from inspect import Parameter from parso.python.parser import Parser from parso.python import tree from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer...
null
176,480
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,481
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,482
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,483
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,484
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
Returns the scope in which the user resides. This includes flows.
176,485
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,486
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,487
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,488
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,489
import re from textwrap import dedent from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi import debug from jedi import settings from jedi.api import classes from jedi.api import ...
null
176,490
import __main__ from collections import namedtuple import logging import traceback import re import os import sys from jedi import Interpreter READLINE_DEBUG = False The provided code snippet includes necessary dependencies for implementing the `setup_readline` function. Write a Python function `def setup_readline(na...
This function sets up :mod:`readline` to use Jedi in a Python interactive shell. If you want to use a custom ``PYTHONSTARTUP`` file (typically ``$HOME/.pythonrc.py``), you can add this piece of code:: try: from jedi.utils import setup_readline except ImportError: # Fallback to the stdlib readline completer if it is ins...
176,491
import __main__ from collections import namedtuple import logging import traceback import re import os import sys from jedi import Interpreter def namedtuple( typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Union[str, unicode]]], verbose: bool = ..., rename: bool = ..., ) -> T...
Returns a namedtuple of Jedi's version, similar to Python's ``sys.version_info``.
176,492
from jedi import settings from jedi import debug from jedi.parser_utils import get_parent_scope from jedi.inference.cache import inference_state_method_cache from jedi.inference.arguments import TreeArguments from jedi.inference.param import get_executed_param_names from jedi.inference.helpers import is_stdlib_path fro...
null
176,493
from jedi import settings from jedi import debug from jedi.parser_utils import get_parent_scope from jedi.inference.cache import inference_state_method_cache from jedi.inference.arguments import TreeArguments from jedi.inference.param import get_executed_param_names from jedi.inference.helpers import is_stdlib_path fro...
A dynamic search for param values. If you try to complete a type: >>> def func(foo): ... foo >>> func(1) >>> func("") It is not known what the type ``foo`` without analysing the whole code. You have to look for all calls to ``func`` to find out what ``foo`` possibly is.
176,494
from jedi import debug from jedi import settings from jedi.inference import recursion from jedi.inference.base_value import ValueSet, NO_VALUES, HelperValueMixin, \ ValueWrapper from jedi.inference.lazy_value import LazyKnownValues from jedi.inference.helpers import infer_call_of_leaf from jedi.inference.cache impo...
Just a mapper function for the internal _internal_check_array_additions
176,495
from jedi import debug from jedi import settings from jedi.inference import recursion from jedi.inference.base_value import ValueSet, NO_VALUES, HelperValueMixin, \ ValueWrapper from jedi.inference.lazy_value import LazyKnownValues from jedi.inference.helpers import infer_call_of_leaf from jedi.inference.cache impo...
Used for set() and list() instances.
176,496
from parso.python import tree from jedi import debug from jedi.inference.cache import inference_state_method_cache, CachedMetaClass from jedi.inference import compiled from jedi.inference import recursion from jedi.inference import docstrings from jedi.inference import flow_analysis from jedi.inference.signature import...
null
176,497
from jedi.inference import compiled from jedi.inference import analysis from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ LazyTreeValue from jedi.inference.helpers import get_int_or_none, is_string, \ reraise_getitem_errors, SimpleGetItemNotFound from jedi.inference.utils import safe_prop...
Unpacking tuple assignments in for statements and expr_stmts.
176,498
from abc import abstractmethod from inspect import Parameter from typing import Optional, Tuple from parso.tree import search_ancestor from jedi.parser_utils import find_statement_documentation, clean_scope_docstring from jedi.inference.utils import unite from jedi.inference.base_value import ValueSet, NO_VALUES from j...
null
176,499
import functools import re import os def to_list(func): def wrapper(*args, **kwargs): return list(func(*args, **kwargs)) return wrapper
null
176,500
import functools import re import os def to_tuple(func): def wrapper(*args, **kwargs): return tuple(func(*args, **kwargs)) return wrapper
null
176,501
import functools import re import os def reraise_uncaught(func): """ Re-throw uncaught `AttributeError`. Usage: Put ``@rethrow_uncaught`` in front of the function which does **not** suppose to raise `AttributeError`. AttributeError is easily get caught by `hasattr` and another ``except Attribut...
null
176,502
import re from itertools import zip_longest from parso.python import tree from jedi import debug from jedi.inference.utils import PushBackIterator from jedi.inference import analysis from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ LazyTreeValue, get_merged_lazy_value from jedi.inference.nam...
Helper method for static analysis.
176,503
import re from itertools import zip_longest from parso.python import tree from jedi import debug from jedi.inference.utils import PushBackIterator from jedi.inference import analysis from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ LazyTreeValue, get_merged_lazy_value from jedi.inference.nam...
Transforms a function or method with arguments to the signature that is given as an argument clinic notation. Argument clinic is part of CPython and used for all the functions that are implemented in C (Python 3.7): str.split.__text_signature__ # Results in: '($self, /, sep=None, maxsplit=-1)'
176,504
import re from itertools import zip_longest from parso.python import tree from jedi import debug from jedi.inference.utils import PushBackIterator from jedi.inference import analysis from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ LazyTreeValue, get_merged_lazy_value from jedi.inference.nam...
null
176,505
import re from itertools import zip_longest from parso.python import tree from jedi import debug from jedi.inference.utils import PushBackIterator from jedi.inference import analysis from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ LazyTreeValue, get_merged_lazy_value from jedi.inference.nam...
null
176,506
import re from itertools import zip_longest from parso.python import tree from jedi import debug from jedi.inference.utils import PushBackIterator from jedi.inference import analysis from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ LazyTreeValue, get_merged_lazy_value from jedi.inference.nam...
null
176,507
from contextlib import contextmanager from jedi import debug from jedi.inference.base_value import NO_VALUES NO_VALUES = ValueSet([]) def execution_recursion_decorator(default=NO_VALUES): def decorator(func): def wrapper(self, **kwargs): detector = self.inference_state.execution_recursion_dete...
null
176,508
import os import re from pathlib import Path from importlib.machinery import all_suffixes from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import ContextualizedNode from jedi.inference.helpers import is_string, get_str_or_none from jedi.parser_utils import get_cached_code_lin...
null
176,509
from typing import Dict, Optional from jedi.parser_utils import get_flow_branch_keyword, is_scope, get_parent_scope from jedi.inference.recursion import execution_allowed from jedi.inference.helpers import is_big_annoying_library REACHABLE = Status(True, 'reachable') UNREACHABLE = Status(False, 'unreachable') UNSURE = ...
null
176,510
import re import warnings from parso import parse, ParserSyntaxError from jedi import debug from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import iterator_to_value_set, ValueSet, \ NO_VALUES from jedi.inference.lazy_value import LazyKnownValues def _search_param_in_docs...
null
176,511
import re import warnings from parso import parse, ParserSyntaxError from jedi import debug from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import iterator_to_value_set, ValueSet, \ NO_VALUES from jedi.inference.lazy_value import LazyKnownValues DOCSTRING_RETURN_PATTERNS...
null
176,512
from inspect import Parameter from parso import tree from jedi.inference.utils import to_list from jedi.inference.names import ParamNameWrapper from jedi.inference.helpers import is_big_annoying_library def _iter_nodes_for_param(param_name): from parso.python.tree import search_ancestor from jedi.inference.argu...
null
176,513
from abc import abstractmethod from typing import List, MutableMapping, Type import weakref from parso.tree import search_ancestor from parso.python.tree import Name, UsedNamesMapping from jedi.inference import flow_analysis from jedi.inference.base_value import ValueSet, ValueWrapper, \ LazyValueWrapper from jedi....
null
176,514
from abc import abstractmethod from typing import List, MutableMapping, Type import weakref from parso.tree import search_ancestor from parso.python.tree import Name, UsedNamesMapping from jedi.inference import flow_analysis from jedi.inference.base_value import ValueSet, ValueWrapper, \ LazyValueWrapper from jedi....
null
176,515
from functools import wraps from jedi import debug _NO_DEFAULT = object() def _memoize_default(default=_NO_DEFAULT, inference_state_is_first_arg=False, second_arg_is_inference_state=False): """ This is a typical memoization decorator, BUT there is one difference: To prevent recursion it set...
null
176,516
from functools import wraps from jedi import debug _NO_DEFAULT = object() def _memoize_default(default=_NO_DEFAULT, inference_state_is_first_arg=False, second_arg_is_inference_state=False): """ This is a typical memoization decorator, BUT there is one difference: To prevent recursion it set...
null
176,517
from functools import wraps from jedi import debug def _memoize_default(default=_NO_DEFAULT, inference_state_is_first_arg=False, second_arg_is_inference_state=False): """ This is a typical memoization decorator, BUT there is one difference: To prevent recursion it sets defaults. Prevent...
null
176,518
from functools import wraps from jedi import debug _RECURSION_SENTINEL = object() def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_T], _T]: ... The provided code snippet includes necessary dependencies for implementing the `inference_state_method_generator_ca...
This is a special memoizer. It memoizes generators and also checks for recursion errors and returns no further iterator elemends in that case.
176,519
import inspect import types import traceback import sys import operator as op from collections import namedtuple import warnings import re import builtins import typing from pathlib import Path from typing import Optional from jedi.inference.compiled.getattr_static import getattr_static _sentinel = object() ALLOWED_DES...
null
176,520
import inspect import types import traceback import sys import operator as op from collections import namedtuple import warnings import re import builtins import typing from pathlib import Path from typing import Optional from jedi.inference.compiled.getattr_static import getattr_static def shorten_repr(func): def...
null
176,521
import inspect import types import traceback import sys import operator as op from collections import namedtuple import warnings import re import builtins import typing from pathlib import Path from typing import Optional from jedi.inference.compiled.getattr_static import getattr_static def create_access_path(inference...
null
176,522
import inspect import types import traceback import sys import operator as op from collections import namedtuple import warnings import re import builtins import typing from pathlib import Path from typing import Optional from jedi.inference.compiled.getattr_static import getattr_static NOT_CLASS_TYPES = ( types.Bu...
Like inspect.* methods.
176,523
import sys import os import inspect import importlib import warnings from pathlib import Path from zipfile import ZipFile from zipimport import zipimporter, ZipImportError from importlib.machinery import all_suffixes from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils from je...
null
176,524
import sys import os import inspect import importlib import warnings from pathlib import Path from zipfile import ZipFile from zipimport import zipimporter, ZipImportError from importlib.machinery import all_suffixes from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils from je...
null
176,525
import sys import os import inspect import importlib import warnings from pathlib import Path from zipfile import ZipFile from zipimport import zipimporter, ZipImportError from importlib.machinery import all_suffixes from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils from je...
Raise an error to simulate certain problems for unit tests.
176,526
import sys import os import inspect import importlib import warnings from pathlib import Path from zipfile import ZipFile from zipimport import zipimporter, ZipImportError from importlib.machinery import all_suffixes from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils from je...
Force some prints in the subprocesses. This exists for unit tests.
176,527
import sys import os import inspect import importlib import warnings from pathlib import Path from zipfile import ZipFile from zipimport import zipimporter, ZipImportError from importlib.machinery import all_suffixes from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils from je...
The __init__ file can be searched in a directory. If found return it, else None.
176,528
import sys import os import inspect import importlib import warnings from pathlib import Path from zipfile import ZipFile from zipimport import zipimporter, ZipImportError from importlib.machinery import all_suffixes from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils from je...
null
176,529
import sys import os import inspect import importlib import warnings from pathlib import Path from zipfile import ZipFile from zipimport import zipimporter, ZipImportError from importlib.machinery import all_suffixes from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils from je...
null
176,530
import os import sys from importlib.abc import MetaPathFinder from importlib.machinery import PathFinder del sys.path[0] sys.meta_path.insert(0, _ExactImporter(_get_paths())) from jedi.inference.compiled import subprocess sys.meta_path.pop(0) import sys if sys.version_info >= (3, 9): from types import GenericAli...
null
176,531
import inspect from pathlib import Path from jedi.parser_utils import get_cached_code_lines from jedi import settings from jedi.cache import memoize_method from jedi.inference import compiled from jedi.file_io import FileIO from jedi.inference.names import NameWrapper from jedi.inference.base_value import ValueSet, Val...
null
176,532
import re from functools import partial from inspect import Parameter from pathlib import Path from typing import Optional from jedi import debug from jedi.inference.utils import to_list from jedi.cache import memoize_method from jedi.inference.filters import AbstractFilter from jedi.inference.names import AbstractName...
Takes a function and returns the params and return value as a tuple. This is nothing more than a docstring parser. TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None TODO docstrings like 'tuple of integers'
176,533
import re from functools import partial from inspect import Parameter from pathlib import Path from typing import Optional from jedi import debug from jedi.inference.utils import to_list from jedi.cache import memoize_method from jedi.inference.filters import AbstractFilter from jedi.inference.names import AbstractName...
null
176,534
import re from functools import partial from inspect import Parameter from pathlib import Path from typing import Optional from jedi import debug from jedi.inference.utils import to_list from jedi.cache import memoize_method from jedi.inference.filters import AbstractFilter from jedi.inference.names import AbstractName...
The cache doesn't care about keyword vs. normal args.
176,535
import re from functools import partial from inspect import Parameter from pathlib import Path from typing import Optional from jedi import debug from jedi.inference.utils import to_list from jedi.cache import memoize_method from jedi.inference.filters import AbstractFilter from jedi.inference.names import AbstractName...
null
176,536
import os import re from parso import python_bytes_to_unicode from jedi.debug import dbg from jedi.file_io import KnownContentFileIO, FolderIO from jedi.inference.names import SubModuleName from jedi.inference.imports import load_module_from_path from jedi.inference.filters import ParserTreeFilter from jedi.inference.g...
null
176,537
import os import re from parso import python_bytes_to_unicode from jedi.debug import dbg from jedi.file_io import KnownContentFileIO, FolderIO from jedi.inference.names import SubModuleName from jedi.inference.imports import load_module_from_path from jedi.inference.filters import ParserTreeFilter from jedi.inference.g...
null
176,538
import copy import sys import re import os from itertools import chain from contextlib import contextmanager from parso.python import tree The provided code snippet includes necessary dependencies for implementing the `deep_ast_copy` function. Write a Python function `def deep_ast_copy(obj)` to solve the following pro...
Much, much faster than copy.deepcopy, but just for parser tree nodes.
176,539
import copy import sys import re import os from itertools import chain from contextlib import contextmanager from parso.python import tree def _get_safe_value_or_none(value, accept): value = value.get_safe_value(default=None) if isinstance(value, accept): return value def get_int_or_none(value): re...
null
176,540
import copy import sys import re import os from itertools import chain from contextlib import contextmanager from parso.python import tree class SimpleGetItemNotFound(Exception): pass def reraise_getitem_errors(*exception_classes): try: yield except exception_classes as e: raise SimpleGetIt...
null
176,541
import copy import sys import re import os from itertools import chain from contextlib import contextmanager from parso.python import tree def values_from_qualified_names(inference_state, *names): return inference_state.import_module(names[:-1]).py__getattribute__(names[-1])
null
176,542
from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.common import monkeypatch class MergedLazyValues(AbstractLazyValue): """data is a list of lazy values.""" def infer(self): return ValueSet.from_sets(l.infer() for l in self.data) def get_merged_lazy_value(lazy_values): if len(lazy_...
null
176,543
from jedi.inference.cache import inference_state_function_cache def get_yield_exprs(inference_state, funcdef): return list(funcdef.iter_yield_exprs())
null
176,544
from parso.python import tree from jedi import debug from jedi.inference.helpers import is_string class Error: def __init__(self, name, module_path, start_pos, message=None): def line(self): def column(self): def code(self): def __str__(self): def __eq__(self, other): def __ne__(self,...
null
176,545
from functools import reduce from operator import add from itertools import zip_longest from parso.python.tree import Name from jedi import debug from jedi.parser_utils import clean_scope_docstring from jedi.inference.helpers import SimpleGetItemNotFound from jedi.inference.utils import safe_property from jedi.inferenc...
null
176,546
from functools import reduce from operator import add from itertools import zip_longest from parso.python.tree import Name from jedi import debug from jedi.parser_utils import clean_scope_docstring from jedi.inference.helpers import SimpleGetItemNotFound from jedi.inference.utils import safe_property from jedi.inferenc...
null
176,547
from abc import abstractmethod from contextlib import contextmanager from pathlib import Path from typing import Optional from parso.tree import search_ancestor from parso.python.tree import Name from jedi.inference.filters import ParserTreeFilter, MergedFilter, \ GlobalNameFilter from jedi.inference.names import A...
null
176,548
from parso.tree import search_ancestor from parso.python.tree import Name from jedi import settings from jedi.inference.arguments import TreeArguments from jedi.inference.value import iterable from jedi.inference.base_value import NO_VALUES from jedi.parser_utils import is_scope def _remove_del_stmt(names): # Catch...
Searches names that are defined in a scope (the different ``filters``), until a name fits.
176,549
from parso.tree import search_ancestor from parso.python.tree import Name from jedi import settings from jedi.inference.arguments import TreeArguments from jedi.inference.value import iterable from jedi.inference.base_value import NO_VALUES from jedi.parser_utils import is_scope def _check_isinstance_type(value, node, ...
Try to find out the type of a variable just with the information that is given by the flows: e.g. It is also responsible for assert checks.:: if isinstance(k, str): k. # <- completion here ensures that `k` is a string.
176,550
import os from pathlib import Path from parso.python import tree from parso.tree import search_ancestor from jedi import debug from jedi import settings from jedi.file_io import FolderIO from jedi.parser_utils import get_cached_code_lines from jedi.inference import sys_path from jedi.inference import helpers from jedi....
null
176,551
import os from pathlib import Path from parso.python import tree from parso.tree import search_ancestor from jedi import debug from jedi import settings from jedi.file_io import FolderIO from jedi.parser_utils import get_cached_code_lines from jedi.inference import sys_path from jedi.inference import helpers from jedi....
In case the level is outside of the currently known package (something like import .....foo), we can still try our best to help the user for completions.
176,552
import os from pathlib import Path from parso.python import tree from parso.tree import search_ancestor from jedi import debug from jedi import settings from jedi.file_io import FolderIO from jedi.parser_utils import get_cached_code_lines from jedi.inference import sys_path from jedi.inference import helpers from jedi....
null
176,553
import os from pathlib import Path from parso.python import tree from parso.tree import search_ancestor from jedi import debug from jedi import settings from jedi.file_io import FolderIO from jedi.parser_utils import get_cached_code_lines from jedi.inference import sys_path from jedi.inference import helpers from jedi....
null
176,554
import os from pathlib import Path from parso.python import tree from parso.tree import search_ancestor from jedi import debug from jedi import settings from jedi.file_io import FolderIO from jedi.parser_utils import get_cached_code_lines from jedi.inference import sys_path from jedi.inference import helpers from jedi....
null
176,555
import os from pathlib import Path from parso.python import tree from parso.tree import search_ancestor from jedi import debug from jedi import settings from jedi.file_io import FolderIO from jedi.parser_utils import get_cached_code_lines from jedi.inference import sys_path from jedi.inference import helpers from jedi....
Get the names of all modules in the search_path. This means file names and not names defined in the files.
176,556
import copy import itertools from parso.python import tree from jedi import debug from jedi import parser_utils from jedi.inference.base_value import ValueSet, NO_VALUES, ContextualizedNode, \ iterator_to_value_set, iterate_values from jedi.inference.lazy_value import LazyTreeValue from jedi.inference import compil...
This is for now the way how we limit type inference going wild. There are other ways to ensure recursion limits as well. This is mostly necessary because of instance (self) access that can be quite tricky to limit. I'm still not sure this is the way to go, but it looks okay for now and we can still go anther way in the...
176,557
import copy import itertools from parso.python import tree from jedi import debug from jedi import parser_utils from jedi.inference.base_value import ValueSet, NO_VALUES, ContextualizedNode, \ iterator_to_value_set, iterate_values from jedi.inference.lazy_value import LazyTreeValue from jedi.inference import compil...
null
176,558
from pathlib import Path from jedi.inference.gradual.typeshed import TYPESHED_PATH, create_stub_module class Path(PurePath): def __new__(cls: Type[_P], *args: Union[str, _PathLike], **kwargs: Any) -> _P: ... def __enter__(self: _P) -> _P: ... def __exit__( self, exc_type: Optional[Type[BaseExceptio...
This function is given a random .pyi file and should return the proper module.
176,559
import re from inspect import Parameter from parso import ParserSyntaxError, parse from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.gradual.base import DefineGenericBaseClass, GenericClass from jedi.inference.gradual.generics imp...
null
176,560
import re from inspect import Parameter from parso import ParserSyntaxError, parse from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.gradual.base import DefineGenericBaseClass, GenericClass from jedi.inference.gradual.generics imp...
Infers the type of a function's return value, according to type annotations.
176,561
import re from inspect import Parameter from parso import ParserSyntaxError, parse from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.gradual.base import DefineGenericBaseClass, GenericClass from jedi.inference.gradual.generics imp...
null
176,562
import re from inspect import Parameter from parso import ParserSyntaxError, parse from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.gradual.base import DefineGenericBaseClass, GenericClass from jedi.inference.gradual.generics imp...
Match up the generic parameters from the given argument class to the target annotation. This walks the generic parameters immediately within the annotation and argument's type, in order to determine the concrete values of the annotation's parameters for the current case. For example, given the following code: def value...
176,563
from jedi import debug from jedi.cache import memoize_method from jedi.inference.utils import to_tuple from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.value.iterable import SequenceLiteralValue from jedi.inference.helpers import is_string def is_string(value): return value.is_compiled...
null
176,564
import os import re from functools import wraps from collections import namedtuple from typing import Dict, Mapping, Tuple from pathlib import Path from jedi import settings from jedi.file_io import FileIO from jedi.parser_utils import get_cached_code_lines from jedi.inference.base_value import ValueSet, NO_VALUES from...
null
176,565
import re import textwrap from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary from parso.python import tree from parso.cache import parser_cache from parso import split_lines _EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test', 'or_...
For static analysis.
176,566
import re import textwrap from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary from parso.python import tree from parso.cache import parser_cache from parso import split_lines def get_sync_comp_fors(comp_for): yield comp_for last = comp_for.children[-1] while True...
null
176,567
import re import textwrap from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary from parso.python import tree from parso.cache import parser_cache from parso import split_lines def safe_literal_eval(value): first_two = value[:2].lower() if first_two[0] == 'f' or first_t...
Returns a cleaned version of the docstring token.
176,568
import re import textwrap from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary from parso.python import tree from parso.cache import parser_cache from parso import split_lines def safe_literal_eval(value): first_two = value[:2].lower() if first_two[0] == 'f' or first_t...
null
176,569
import re import textwrap from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary from parso.python import tree from parso.cache import parser_cache from parso import split_lines The provided code snippet includes necessary dependencies for implementing the `get_signature` funct...
Generate a string signature of a function. :param width: Fold lines if a line is longer than this value. :type width: int :arg func_name: Override function name when given. :type func_name: str :rtype: str
176,570
import re import textwrap from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary from parso.python import tree from parso.cache import parser_cache from parso import split_lines class WeakKeyDictionary(MutableMapping[_KT, _VT]): def __init__(self, dict: None = ...) -> None:...
null