fname stringlengths 63 176 | rel_fname stringclasses 706
values | line int64 -1 4.5k | name stringlengths 1 81 | kind stringclasses 2
values | category stringclasses 2
values | info stringlengths 0 77.9k ⌀ |
|---|---|---|---|---|---|---|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 53 | _build_suggested_string | def | function | def _build_suggested_string(node: nodes.For, final_return_bool: bool) -> str:
"""When a nodes.For node can be rewritten as an any/all statement, return a suggestion for that statement
final_return_bool is the boolean literal returned after the for loop if all conditions fail.
"""
loo... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 57 | as_string | ref | function | loop_var = node.target.as_string()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 58 | as_string | ref | function | loop_iter = node.iter.as_string()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 59 | get_children | ref | function | test_node = next(node.body[0].get_children())
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 68 | as_string | ref | function | test = test_node.as_string()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 72 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(ConsiderUsingAnyOrAllChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 73 | register_checker | ref | function | linter.register_checker(ConsiderUsingAnyOrAllChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/for_any_all.py | pylint/extensions/for_any_all.py | 73 | ConsiderUsingAnyOrAllChecker | ref | function | linter.register_checker(ConsiderUsingAnyOrAllChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 22 | PathGraph | def | class | __init__ |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 28 | PathGraphingAstVisitor | def | class | __init__ default dispatch visitFunctionDef visitSimpleStatement visitWith _append_node _subgraph _subgraph_parse |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 33 | default | def | function | def default(self, node, *args):
for child in node.get_children():
self.dispatch(child, *args)
def dispatch(self, node, *args):
self.node = node
klass = node.__class__
meth = self._cache.get(klass)
if meth is None:
class_name = klass.__name__
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 34 | get_children | ref | function | for child in node.get_children():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 35 | dispatch | ref | function | self.dispatch(child, *args)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 37 | dispatch | def | function | def dispatch(self, node, *args):
self.node = node
klass = node.__class__
meth = self._cache.get(klass)
if meth is None:
class_name = klass.__name__
meth = getattr(self.visitor, "visit" + class_name, self.default)
self._cache[klass] = meth
r... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 45 | meth | ref | function | return meth(node, *args)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 47 | visitFunctionDef | def | function | def visitFunctionDef(self, node):
if self.graph is not None:
# closure
pathnode = self._append_node(node)
self.tail = pathnode
self.dispatch_list(node.body)
bottom = f"{self._bottom_counter}"
self._bottom_counter += 1
self.g... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 50 | _append_node | ref | function | pathnode = self._append_node(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 52 | dispatch_list | ref | function | self.dispatch_list(node.body)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 55 | connect | ref | function | self.graph.connect(self.tail, bottom)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 56 | connect | ref | function | self.graph.connect(node, bottom)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 59 | PathGraph | ref | function | self.graph = PathGraph(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 61 | dispatch_list | ref | function | self.dispatch_list(node.body)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 63 | reset | ref | function | self.reset()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 67 | visitSimpleStatement | def | function | def visitSimpleStatement(self, node):
self._append_node(node)
visitAssert = (
visitAssign
) = (
visitAugAssign
) = (
visitDelete
) = (
visitPrint
) = (
visitRaise
) = (
visitYield
) = (
visitImport
) = (
visitCa... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 68 | _append_node | ref | function | self._append_node(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 96 | visitWith | def | function | def visitWith(self, node):
self._append_node(node)
self.dispatch_list(node.body)
visitAsyncWith = visitWith
def _append_node(self, node):
if not self.tail:
return None
self.graph.connect(self.tail, node)
self.tail = node
return node
def _sub... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 97 | _append_node | ref | function | self._append_node(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 98 | dispatch_list | ref | function | self.dispatch_list(node.body)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 102 | _append_node | def | function | def _append_node(self, node):
if not self.tail:
return None
self.graph.connect(self.tail, node)
self.tail = node
return node
def _subgraph(self, node, name, extra_blocks=()):
"""Create the subgraphs representing any `if` and `for` statements."""
if se... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 105 | connect | ref | function | self.graph.connect(self.tail, node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 109 | _subgraph | def | function | def _subgraph(self, node, name, extra_blocks=()):
"""Create the subgraphs representing any `if` and `for` statements."""
if self.graph is None:
# global loop
self.graph = PathGraph(node)
self._subgraph_parse(node, node, extra_blocks)
self.graphs[f"{sel... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 113 | PathGraph | ref | function | self.graph = PathGraph(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 114 | _subgraph_parse | ref | function | self._subgraph_parse(node, node, extra_blocks)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 116 | reset | ref | function | self.reset()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 118 | _append_node | ref | function | self._append_node(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 119 | _subgraph_parse | ref | function | self._subgraph_parse(node, node, extra_blocks)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 121 | _subgraph_parse | def | function | def _subgraph_parse(self, node, pathnode, extra_blocks):
"""Parse the body and any `else` block of `if` and `for` statements."""
loose_ends = []
self.tail = node
self.dispatch_list(node.body)
loose_ends.append(self.tail)
for extra in extra_blocks:
self.tai... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 125 | dispatch_list | ref | function | self.dispatch_list(node.body)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 129 | dispatch_list | ref | function | self.dispatch_list(extra.body)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 133 | dispatch_list | ref | function | self.dispatch_list(node.orelse)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 141 | connect | ref | function | self.graph.connect(end, bottom)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 145 | McCabeMethodChecker | def | class | visit_module |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 172 | only_required_for_messages | ref | function | @only_required_for_messages("too-complex")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 173 | visit_module | def | function | def visit_module(self, node: nodes.Module) -> None:
"""Visit an astroid.Module node to check too complex rating and
add message if is greater than max_complexity stored from options.
"""
visitor = PathGraphingAstVisitor()
for child in node.body:
visitor.preorder(c... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 177 | PathGraphingAstVisitor | ref | function | visitor = PathGraphingAstVisitor()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 179 | preorder | ref | function | visitor.preorder(child, visitor)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 181 | complexity | ref | function | complexity = graph.complexity()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 189 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 194 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(McCabeMethodChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 195 | register_checker | ref | function | linter.register_checker(McCabeMethodChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/mccabe.py | pylint/extensions/mccabe.py | 195 | McCabeMethodChecker | ref | function | linter.register_checker(McCabeMethodChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 21 | OverlappingExceptionsChecker | def | class | visit_tryexcept |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 38 | only_required_for_messages | ref | function | @utils.only_required_for_messages("overlapping-except")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 39 | visit_tryexcept | def | function | def visit_tryexcept(self, node: nodes.TryExcept) -> None:
"""Check for empty except."""
for handler in node.handlers:
if handler.type is None:
continue
if isinstance(handler.type, astroid.BoolOp):
continue
try:
excs ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 47 | _annotated_unpack_infer | ref | function | excs = list(_annotated_unpack_infer(handler.type))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 55 | inherit_from_std_ex | ref | function | if isinstance(exc, astroid.Instance) and utils.inherit_from_std_ex(exc):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 62 | ancestors | ref | function | anc for anc in exc.ancestors() if isinstance(anc, astroid.ClassDef)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 68 | ancestors | ref | function | for anc in prev_exc.ancestors()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 72 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 75 | as_string | ref | function | args=f"{prev_part.as_string()} and {part.as_string()} are the same",
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 75 | as_string | ref | function | args=f"{prev_part.as_string()} and {part.as_string()} are the same",
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 80 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 83 | as_string | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 83 | as_string | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 88 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(OverlappingExceptionsChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 89 | register_checker | ref | function | linter.register_checker(OverlappingExceptionsChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/overlapping_exceptions.py | pylint/extensions/overlapping_exceptions.py | 89 | OverlappingExceptionsChecker | ref | function | linter.register_checker(OverlappingExceptionsChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 20 | PrivateImportChecker | def | class | __init__ visit_import visit_importfrom _get_private_imports _name_is_private _get_type_annotation_names _populate_type_annotations _populate_type_annotations_function _populate_type_annotations_annotation _assignments_call_private_name same_root_dir |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 40 | only_required_for_messages | ref | function | @utils.only_required_for_messages("import-private-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 41 | visit_import | def | function | def visit_import(self, node: nodes.Import) -> None:
if utils.is_node_in_typing_guarded_import_block(node):
return
names = [name[0] for name in node.names]
private_names = self._get_private_imports(names)
private_names = self._get_type_annotation_names(node, private_names)... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 42 | is_node_in_typing_guarded_import_block | ref | function | if utils.is_node_in_typing_guarded_import_block(node):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 45 | _get_private_imports | ref | function | private_names = self._get_private_imports(names)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 46 | _get_type_annotation_names | ref | function | private_names = self._get_type_annotation_names(node, private_names)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 50 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 57 | only_required_for_messages | ref | function | @utils.only_required_for_messages("import-private-name")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 58 | visit_importfrom | def | function | def visit_importfrom(self, node: nodes.ImportFrom) -> None:
if utils.is_node_in_typing_guarded_import_block(node):
return
# Only check imported names if the module is external
if self.same_root_dir(node, node.modname):
return
names = [n[0] for n in node.names... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 59 | is_node_in_typing_guarded_import_block | ref | function | if utils.is_node_in_typing_guarded_import_block(node):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 62 | same_root_dir | ref | function | if self.same_root_dir(node, node.modname):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 68 | _get_type_annotation_names | ref | function | private_names = self._get_type_annotation_names(node, names)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 73 | _get_private_imports | ref | function | private_module_imports = self._get_private_imports([node.modname])
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 74 | _get_type_annotation_names | ref | function | private_module_imports = self._get_type_annotation_names(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 78 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 86 | _get_private_imports | ref | function | private_names = self._get_private_imports(private_names)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 91 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 98 | _get_private_imports | def | function | def _get_private_imports(self, names: list[str]) -> list[str]:
"""Returns the private names from input names by a simple string check."""
return [name for name in names if self._name_is_private(name)]
@staticmethod
def _name_is_private(name: str) -> bool:
"""Returns true if the name... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 100 | _name_is_private | ref | function | return [name for name in names if self._name_is_private(name)]
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 103 | _name_is_private | def | function | def _name_is_private(name: str) -> bool:
"""Returns true if the name exists, starts with `_`, and if len(name) > 4
it is not a dunder, i.e. it does not begin and end with two underscores.
"""
return (
bool(name)
and name[0] == "_"
and (len(name) <=... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 113 | _get_type_annotation_names | def | function | def _get_type_annotation_names(
self, node: nodes.Import | nodes.ImportFrom, names: list[str]
) -> list[str]:
"""Removes from names any names that are used as type annotations with no other illegal usages."""
if names and not self.populated_annotations:
self._populate_type_an... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 118 | _populate_type_annotations | ref | function | self._populate_type_annotations(node.root(), self.all_used_type_annotations)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 118 | root | ref | function | self._populate_type_annotations(node.root(), self.all_used_type_annotations)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 131 | _populate_type_annotations | def | function | def _populate_type_annotations(
self, node: nodes.LocalsDictNodeNG, all_used_type_annotations: dict[str, bool]
) -> None:
"""Adds into the dict `all_used_type_annotations` the names of all names ever used as a type annotation
in the scope and nested scopes of node and whether these names... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 149 | _populate_type_annotations_annotation | ref | function | private_name = self._populate_type_annotations_annotation(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 156 | _populate_type_annotations_function | ref | function | self._populate_type_annotations_function(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 160 | _populate_type_annotations | ref | function | self._populate_type_annotations(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 167 | _assignments_call_private_name | ref | function | ] = self._assignments_call_private_name(name_assignments, private_name)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 169 | _populate_type_annotations_function | def | function | def _populate_type_annotations_function(
self, node: nodes.FunctionDef, all_used_type_annotations: dict[str, bool]
) -> None:
"""Adds into the dict `all_used_type_annotations` the names of all names used as a type annotation
in the arguments and return type of the function node.
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 177 | _populate_type_annotations_annotation | ref | function | self._populate_type_annotations_annotation(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 181 | _populate_type_annotations_annotation | ref | function | self._populate_type_annotations_annotation(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 185 | _populate_type_annotations_annotation | def | function | def _populate_type_annotations_annotation(
self,
node: nodes.Attribute | nodes.Subscript | nodes.Name | None,
all_used_type_annotations: dict[str, bool],
) -> str | None:
"""Handles the possibility of an annotation either being a Name, i.e. just type,
or a Subscript e.g. ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/extensions/private_import.py | pylint/extensions/private_import.py | 198 | _populate_type_annotations_annotation | ref | function | self._populate_type_annotations_annotation(
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.