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/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 761 | _check_nested_blocks | ref | function | self._check_nested_blocks(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 762 | _check_superfluous_else_return | ref | function | self._check_superfluous_else_return(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 763 | _check_superfluous_else_raise | ref | function | self._check_superfluous_else_raise(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 764 | _check_superfluous_else_break | ref | function | self._check_superfluous_else_break(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 765 | _check_superfluous_else_continue | ref | function | self._check_superfluous_else_continue(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 766 | _check_consider_get | ref | function | self._check_consider_get(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 767 | _check_consider_using_min_max_builtin | ref | function | self._check_consider_using_min_max_builtin(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 769 | _check_consider_using_min_max_builtin | def | function | def _check_consider_using_min_max_builtin(self, node: nodes.If):
"""Check if the given if node can be refactored as a min/max python builtin."""
if self._is_actual_elif(node) or node.orelse:
# Not interested in if statements with multiple branches.
return
if len(node... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 771 | _is_actual_elif | ref | function | if self._is_actual_elif(node) or node.orelse:
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 837 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 844 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 848 | check_messages | ref | function | @utils.check_messages("simplifiable-if-expression")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 849 | visit_ifexp | def | function | def visit_ifexp(self, node: nodes.IfExp) -> None:
self._check_simplifiable_ifexp(node)
def _check_simplifiable_ifexp(self, node):
if not isinstance(node.body, nodes.Const) or not isinstance(
node.orelse, nodes.Const
):
return
if not isinstance(node.body.... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 850 | _check_simplifiable_ifexp | ref | function | self._check_simplifiable_ifexp(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 852 | _check_simplifiable_ifexp | def | function | def _check_simplifiable_ifexp(self, node):
if not isinstance(node.body, nodes.Const) or not isinstance(
node.orelse, nodes.Const
):
return
if not isinstance(node.body.value, bool) or not isinstance(
node.orelse.value, bool
):
return
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 875 | add_message | ref | function | self.add_message("simplifiable-if-expression", node=node, args=(reduced_to,))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 877 | check_messages | ref | function | @utils.check_messages(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 883 | leave_functiondef | def | function | def leave_functiondef(self, node: nodes.FunctionDef) -> None:
# check left-over nested blocks stack
self._emit_nested_blocks_message_if_needed(self._nested_blocks)
# new scope = reinitialize the stack of nested blocks
self._nested_blocks = []
# check consistent return stateme... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 885 | _emit_nested_blocks_message_if_needed | ref | function | self._emit_nested_blocks_message_if_needed(self._nested_blocks)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 889 | _check_consistent_returns | ref | function | self._check_consistent_returns(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 891 | _check_return_at_the_end | ref | function | self._check_return_at_the_end(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 894 | _emit_consider_using_with_if_needed | ref | function | self._emit_consider_using_with_if_needed(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 899 | check_messages | ref | function | @utils.check_messages("consider-using-with")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 900 | leave_classdef | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 902 | _emit_consider_using_with_if_needed | ref | function | self._emit_consider_using_with_if_needed(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 907 | check_messages | ref | function | @utils.check_messages("stop-iteration-return")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 908 | visit_raise | def | function | def visit_raise(self, node: nodes.Raise) -> None:
self._check_stop_iteration_inside_generator(node)
def _check_stop_iteration_inside_generator(self, node):
"""Check if an exception of type StopIteration is raised inside a generator."""
frame = node.frame(future=_True)
if not isi... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 909 | _check_stop_iteration_inside_generator | ref | function | self._check_stop_iteration_inside_generator(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 911 | _check_stop_iteration_inside_generator | def | function | def _check_stop_iteration_inside_generator(self, node):
"""Check if an exception of type StopIteration is raised inside a generator."""
frame = node.frame(future=_True)
if not isinstance(frame, nodes.FunctionDef) or not frame.is_generator():
return
if utils.node_ignores_e... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 913 | frame | ref | function | frame = node.frame(future=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 914 | is_generator | ref | function | if not isinstance(frame, nodes.FunctionDef) or not frame.is_generator():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 916 | node_ignores_exception | ref | function | if utils.node_ignores_exception(node, StopIteration):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 920 | safe_infer | ref | function | exc = utils.safe_infer(node.exc)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 923 | _check_exception_inherit_from_stopiteration | ref | function | if self._check_exception_inherit_from_stopiteration(exc):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 924 | add_message | ref | function | self.add_message("stop-iteration-return", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 927 | _check_exception_inherit_from_stopiteration | def | function | def _check_exception_inherit_from_stopiteration(exc):
"""Return _True if the exception node in argument inherit from StopIteration."""
stopiteration_qname = f"{utils.EXCEPTIONS_MODULE}.StopIteration"
return any(_class.qname() == stopiteration_qname for _class in exc.mro())
def _check_co... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 930 | qname | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 930 | mro | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 932 | _check_consider_using_comprehension_constructor | def | function | def _check_consider_using_comprehension_constructor(self, node):
if (
isinstance(node.func, nodes.Name)
and node.args
and isinstance(node.args[0], nodes.ListComp)
):
if node.func.name == "dict":
element = node.args[0].elt
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 955 | as_string | ref | function | key1.as_string() != key2.as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 955 | as_string | ref | function | key1.as_string() != key2.as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 956 | as_string | ref | function | and value1.as_string() != value2.as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 956 | as_string | ref | function | and value1.as_string() != value2.as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 961 | add_message | ref | function | self.add_message(message_name, node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 964 | add_message | ref | function | self.add_message(message_name, node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 966 | _check_consider_using_generator | def | function | def _check_consider_using_generator(self, node):
# 'any' and 'all' definitely should use generator, while 'list' and 'tuple' need to be considered first
# See https://github.com/PyCQA/pylint/pull/3309#discussion_r576683109
checked_call = ["any", "all", "list", "tuple"]
if (
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 980 | as_string | ref | function | inside_comp = node.args[0].as_string()[1:-1]
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 983 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 989 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 995 | check_messages | ref | function | @utils.check_messages(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,006 | visit_call | def | function | def visit_call(self, node: nodes.Call) -> None:
self._check_raising_stopiteration_in_generator_next_call(node)
self._check_consider_using_comprehension_constructor(node)
self._check_quit_exit_call(node)
self._check_super_with_arguments(node)
self._check_consider_using_generat... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,007 | _check_raising_stopiteration_in_generator_next_call | ref | function | self._check_raising_stopiteration_in_generator_next_call(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,008 | _check_consider_using_comprehension_constructor | ref | function | self._check_consider_using_comprehension_constructor(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,009 | _check_quit_exit_call | ref | function | self._check_quit_exit_call(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,010 | _check_super_with_arguments | ref | function | self._check_super_with_arguments(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,011 | _check_consider_using_generator | ref | function | self._check_consider_using_generator(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,012 | _check_consider_using_with | ref | function | self._check_consider_using_with(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,013 | _check_use_list_or_dict_literal | ref | function | self._check_use_list_or_dict_literal(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,016 | _has_exit_in_scope | def | function | def _has_exit_in_scope(scope):
exit_func = scope.locals.get("exit")
return bool(
exit_func and isinstance(exit_func[0], (nodes.ImportFrom, nodes.Import))
)
def _check_quit_exit_call(self, node):
if isinstance(node.func, nodes.Name) and node.func.name in BUILTIN_EXIT... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,022 | _check_quit_exit_call | def | function | def _check_quit_exit_call(self, node):
if isinstance(node.func, nodes.Name) and node.func.name in BUILTIN_EXIT_FUNCS:
# If we have `exit` imported from `sys` in the current or global scope, exempt this instance.
local_scope = node.scope()
if self._has_exit_in_scope(local... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,026 | scope | ref | function | local_scope = node.scope()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,027 | _has_exit_in_scope | ref | function | if self._has_exit_in_scope(local_scope) or self._has_exit_in_scope(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,027 | _has_exit_in_scope | ref | function | if self._has_exit_in_scope(local_scope) or self._has_exit_in_scope(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,028 | root | ref | function | node.root()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,031 | add_message | ref | function | self.add_message("consider-using-sys-exit", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,033 | _check_super_with_arguments | def | function | def _check_super_with_arguments(self, node):
if not isinstance(node.func, nodes.Name) or node.func.name != "super":
return
# pylint: disable=too-many-boolean-expressions
if (
len(node.args) != 2
or not isinstance(node.args[1], nodes.Name)
or n... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,044 | node_frame_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,045 | node_frame_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,049 | add_message | ref | function | self.add_message("super-with-arguments", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,051 | _check_raising_stopiteration_in_generator_next_call | def | function | def _check_raising_stopiteration_in_generator_next_call(self, node):
"""Check if a StopIteration exception is raised by the call to next function.
If the next value has a default value, then do not add message.
:param node: Check to see if this Call node is a next function
:type no... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,060 | _looks_like_infinite_iterator | def | function | def _looks_like_infinite_iterator(param):
inferred = utils.safe_infer(param)
if inferred:
return inferred.qname() in KNOWN_INFINITE_ITERATORS
return _False
if isinstance(node.func, nodes.Attribute):
# A next() method, which is now what we ... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,061 | safe_infer | ref | function | inferred = utils.safe_infer(param)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,063 | qname | ref | function | return inferred.qname() in KNOWN_INFINITE_ITERATORS
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,070 | safe_infer | ref | function | inferred = utils.safe_infer(node.func)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,072 | frame | ref | function | frame = node.frame(future=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,078 | is_generator | ref | function | and frame.is_generator()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,080 | node_ignores_exception | ref | function | and not utils.node_ignores_exception(node, StopIteration)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,081 | _looks_like_infinite_iterator | ref | function | and not _looks_like_infinite_iterator(node.args[0])
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,083 | add_message | ref | function | self.add_message("stop-iteration-return", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,085 | _check_nested_blocks | def | function | def _check_nested_blocks(self, node):
"""Update and check the number of nested blocks."""
# only check block levels inside functions or methods
if not isinstance(node.scope(), nodes.FunctionDef):
return
# messages are triggered on leaving the nested block. Here we save th... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,088 | scope | ref | function | if not isinstance(node.scope(), nodes.FunctionDef):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,093 | scope | ref | function | if node.parent == node.scope():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,102 | _is_actual_elif | ref | function | if isinstance(node, nodes.If) and self._is_actual_elif(node):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,109 | _emit_nested_blocks_message_if_needed | ref | function | self._emit_nested_blocks_message_if_needed(nested_blocks)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,111 | _emit_nested_blocks_message_if_needed | def | function | def _emit_nested_blocks_message_if_needed(self, nested_blocks):
if len(nested_blocks) > self.config.max_nested_blocks:
self.add_message(
"too-many-nested-blocks",
node=nested_blocks[0],
args=(len(nested_blocks), self.config.max_nested_blocks),
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,113 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,119 | _emit_consider_using_with_if_needed | def | function | def _emit_consider_using_with_if_needed(self, stack: Dict[str, nodes.NodeNG]):
for node in stack.values():
self.add_message("consider-using-with", node=node)
@staticmethod
def _duplicated_isinstance_types(node):
"""Get the duplicated types from the underlying isinstance calls.
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,121 | add_message | ref | function | self.add_message("consider-using-with", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,124 | _duplicated_isinstance_types | def | function | def _duplicated_isinstance_types(node):
"""Get the duplicated types from the underlying isinstance calls.
:param nodes.BoolOp node: Node which should contain a bunch of isinstance calls.
:returns: Dictionary of the comparison objects from the isinstance calls,
to duplicate... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,139 | safe_infer | ref | function | inferred = utils.safe_infer(call.func)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,140 | is_builtin_object | ref | function | if not inferred or not utils.is_builtin_object(inferred):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,146 | as_string | ref | function | isinstance_object = call.args[0].as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,154 | as_string | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,154 | itered | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,157 | as_string | ref | function | elems = [isinstance_types.as_string()]
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,165 | _check_consider_merging_isinstance | def | function | def _check_consider_merging_isinstance(self, node):
"""Check isinstance calls which can be merged together."""
if node.op != "or":
return
first_args = self._duplicated_isinstance_types(node)
for duplicated_name, class_names in first_args.items():
names = sort... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,170 | _duplicated_isinstance_types | ref | function | first_args = self._duplicated_isinstance_types(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,173 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,179 | _check_consider_using_in | def | function | def _check_consider_using_in(self, node):
allowed_ops = {"or": "==", "and": "!="}
if node.op not in allowed_ops or len(node.values) < 2:
return
for value in node.values:
if (
not isinstance(value, nodes.Compare)
or len(value.ops) != 1... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 1,202 | as_string | ref | function | variable_set.add(comparable.as_string())
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.