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/extensions/typing.py
pylint/extensions/typing.py
229
qname
ref
function
alias = DEPRECATED_TYPING_ALIASES.get(inferred.qname(), None)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
234
add_message
ref
function
self.add_message(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
237
qname
ref
function
args=(inferred.qname(), alias.name),
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
242
is_node_in_type_annotation_context
ref
function
if not is_node_in_type_annotation_context(node) and isinstance(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
246
qname
ref
function
self._alias_name_collisions.add(inferred.qname())
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
249
DeprecatedTypingAliasMsg
ref
function
DeprecatedTypingAliasMsg(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
251
qname
ref
function
inferred.qname(),
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
257
check_messages
ref
function
@check_messages("consider-using-alias")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
258
leave_module
def
function
def leave_module(self, node: nodes.Module) -> None: """After parsing of module is complete, add messages for 'consider-using-alias' check. Make sure results are safe to recommend / collision free. """ if self._py37_plus and not self._py39_plus: msg_future_import = self._msg_postponed_eval_hint(node) for msg in self._consider_using_alias_msgs: if msg.qname in self._alias_name_collisions: continue self.add_message( "consider-using-alias", node=msg.node, args=( msg.qname, msg.alias, msg_future_import if msg.parent_subscript else "", ), ) # Clear all module cache variables self._alias_name_collisions.clear() self._consider_using_alias_msgs.clear()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
264
_msg_postponed_eval_hint
ref
function
msg_future_import = self._msg_postponed_eval_hint(node)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
268
add_message
ref
function
self.add_message(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
282
register
def
function
def register(linter: "PyLinter") -> None: linter.register_checker(TypingChecker(linter))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
283
register_checker
ref
function
linter.register_checker(TypingChecker(linter))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/typing.py
pylint/extensions/typing.py
283
TypingChecker
ref
function
linter.register_checker(TypingChecker(linter))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/while_used.py
pylint/extensions/while_used.py
13
WhileChecker
def
class
visit_while
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/while_used.py
pylint/extensions/while_used.py
25
check_messages
ref
function
@check_messages("while-used")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/while_used.py
pylint/extensions/while_used.py
26
visit_while
def
function
def visit_while(self, node: nodes.While) -> None: self.add_message("while-used", node=node)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/while_used.py
pylint/extensions/while_used.py
27
add_message
ref
function
self.add_message("while-used", node=node)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/while_used.py
pylint/extensions/while_used.py
30
register
def
function
def register(linter: "PyLinter") -> None: linter.register_checker(WhileChecker(linter))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/while_used.py
pylint/extensions/while_used.py
31
register_checker
ref
function
linter.register_checker(WhileChecker(linter))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/while_used.py
pylint/extensions/while_used.py
31
WhileChecker
ref
function
linter.register_checker(WhileChecker(linter))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
31
target_info_from_filename
def
function
def target_info_from_filename(filename): """Transforms /some/path/foo.png into ('/some/path', 'foo.png', 'png').""" basename = os.path.basename(filename) storedir = os.path.dirname(os.path.abspath(filename)) target = os.path.splitext(filename)[-1][1:] return storedir, basename, target
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
33
basename
ref
function
basename = os.path.basename(filename)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
34
dirname
ref
function
storedir = os.path.dirname(os.path.abspath(filename))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
34
abspath
ref
function
storedir = os.path.dirname(os.path.abspath(filename))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
35
splitext
ref
function
target = os.path.splitext(filename)[-1][1:]
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
39
DotBackend
def
class
__init__ get_source generate emit emit_edge emit_node
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
58
emit
ref
function
self.emit(f"digraph {normalize_node_id(graphname)} {{")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
58
normalize_node_id
ref
function
self.emit(f"digraph {normalize_node_id(graphname)} {{")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
60
emit
ref
function
self.emit(f"rankdir={rankdir}")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
62
emit
ref
function
self.emit(f"ratio={ratio}")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
64
emit
ref
function
self.emit(f'size="{size}"')
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
71
emit
ref
function
self.emit(f'charset="{charset}"')
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
73
emit
ref
function
self.emit("=".join(param))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
75
get_source
def
function
def get_source(self): """Returns self._source.""" if self._source is None: self.emit("}\n") self._source = "\n".join(self.lines) del self.lines return self._source source = property(get_source) def generate( self, outputfile: Optional[str] = None, mapfile: Optional[str] = None ) -> str: """Generates a graph file. :param str outputfile: filename and path [defaults to graphname.png] :param str mapfile: filename and path :rtype: str :return: a path to the generated file :raises RuntimeError: if the executable for rendering was not found """ graphviz_extensions = ("dot", "gv") name = self.graphname if outputfile is None: target = "png" pdot, dot_sourcepath = tempfile.mkstemp(".gv", name) ppng, outputfile = tempfile.mkstemp(".png", name) os.close(pdot) os.close(ppng) else: _, _, target = target_info_from_filename(outputfile) if not target: target = "png" outputfile = outputfile + "." + target if target not in graphviz_extensions: pdot, dot_sourcepath = tempfile.mkstemp(".gv", name) os.close(pdot) else: dot_sourcepath = outputfile with codecs.open(dot_sourcepath, "w", encoding="utf8") as file: file.write(self.source) if target not in graphviz_extensions: if shutil.which(self.renderer) is None: raise RuntimeError( f"Cannot generate `{outputfile}` because '{self.renderer}' " "executable not found. Install graphviz, or specify a `.gv` " "outputfile to produce the DOT source code." ) use_shell = sys.platform == "win32" if mapfile: subprocess.call( [ self.renderer, "-Tcmapx", "-o", mapfile, "-T", target, dot_sourcepath, "-o", outputfile, ], shell=use_shell, ) else: subprocess.call( [self.renderer, "-T", target, dot_sourcepath, "-o", outputfile], shell=use_shell, ) os.unlink(dot_sourcepath) return outputfile def emit(self, line): """Adds <line> to final output.""" self.lines.append(line) def emit_edge(self, name1, name2, **props): """Emit an edge from <name1> to <name2>. edge properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] n_from, n_to = normalize_node_id(name1), normalize_node_id(name2) self.emit(f"{n_from} -> {n_to} [{', '.join(sorted(attrs))}];") def emit_node(self, name, **props): """Emit a node with given properties. node properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
78
emit
ref
function
self.emit("}\n")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
85
generate
def
function
def generate( self, outputfile: Optional[str] = None, mapfile: Optional[str] = None ) -> str: """Generates a graph file. :param str outputfile: filename and path [defaults to graphname.png] :param str mapfile: filename and path :rtype: str :return: a path to the generated file :raises RuntimeError: if the executable for rendering was not found """ graphviz_extensions = ("dot", "gv") name = self.graphname if outputfile is None: target = "png" pdot, dot_sourcepath = tempfile.mkstemp(".gv", name) ppng, outputfile = tempfile.mkstemp(".png", name) os.close(pdot) os.close(ppng) else: _, _, target = target_info_from_filename(outputfile) if not target: target = "png" outputfile = outputfile + "." + target if target not in graphviz_extensions: pdot, dot_sourcepath = tempfile.mkstemp(".gv", name) os.close(pdot) else: dot_sourcepath = outputfile with codecs.open(dot_sourcepath, "w", encoding="utf8") as file: file.write(self.source) if target not in graphviz_extensions: if shutil.which(self.renderer) is None: raise RuntimeError( f"Cannot generate `{outputfile}` because '{self.renderer}' " "executable not found. Install graphviz, or specify a `.gv` " "outputfile to produce the DOT source code." ) use_shell = sys.platform == "win32" if mapfile: subprocess.call( [ self.renderer, "-Tcmapx", "-o", mapfile, "-T", target, dot_sourcepath, "-o", outputfile, ], shell=use_shell, ) else: subprocess.call( [self.renderer, "-T", target, dot_sourcepath, "-o", outputfile], shell=use_shell, ) os.unlink(dot_sourcepath) return outputfile def emit(self, line): """Adds <line> to final output.""" self.lines.append(line) def emit_edge(self, name1, name2, **props): """Emit an edge from <name1> to <name2>. edge properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] n_from, n_to = normalize_node_id(name1), normalize_node_id(name2) self.emit(f"{n_from} -> {n_to} [{', '.join(sorted(attrs))}];") def emit_node(self, name, **props): """Emit a node with given properties. node properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
106
target_info_from_filename
ref
function
_, _, target = target_info_from_filename(outputfile)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
148
emit
def
function
def emit(self, line): """Adds <line> to final output.""" self.lines.append(line) def emit_edge(self, name1, name2, **props): """Emit an edge from <name1> to <name2>. edge properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] n_from, n_to = normalize_node_id(name1), normalize_node_id(name2) self.emit(f"{n_from} -> {n_to} [{', '.join(sorted(attrs))}];") def emit_node(self, name, **props): """Emit a node with given properties. node properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
152
emit_edge
def
function
def emit_edge(self, name1, name2, **props): """Emit an edge from <name1> to <name2>. edge properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] n_from, n_to = normalize_node_id(name1), normalize_node_id(name2) self.emit(f"{n_from} -> {n_to} [{', '.join(sorted(attrs))}];") def emit_node(self, name, **props): """Emit a node with given properties. node properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
157
normalize_node_id
ref
function
n_from, n_to = normalize_node_id(name1), normalize_node_id(name2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
157
normalize_node_id
ref
function
n_from, n_to = normalize_node_id(name1), normalize_node_id(name2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
158
emit
ref
function
self.emit(f"{n_from} -> {n_to} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
160
emit_node
def
function
def emit_node(self, name, **props): """Emit a node with given properties. node properties: see https://www.graphviz.org/doc/info/attrs.html """ attrs = [f'{prop}="{value}"' for prop, value in props.items()] self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
165
emit
ref
function
self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
165
normalize_node_id
ref
function
self.emit(f"{normalize_node_id(name)} [{', '.join(sorted(attrs))}];")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
168
normalize_node_id
def
function
def normalize_node_id(nid): """Returns a suitable DOT node id for `nid`.""" return f'"{nid}"'
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
173
get_cycles
def
function
def get_cycles(graph_dict, vertices=None): """Given a dictionary representing an ordered graph (i.e. key are vertices and values is a list of destination vertices representing edges), return a list of detected cycles """ if not graph_dict: return () result = [] if vertices is None: vertices = graph_dict.keys() for vertice in vertices: _get_cycles(graph_dict, [], set(), result, vertice) return result
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
184
_get_cycles
ref
function
_get_cycles(graph_dict, [], set(), result, vertice)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
188
_get_cycles
def
function
def _get_cycles(graph_dict, path, visited, result, vertice): """Recursive function doing the real work for get_cycles.""" if vertice in path: cycle = [vertice] for node in path[::-1]: if node == vertice: break cycle.insert(0, node) # make a canonical representation start_from = min(cycle) index = cycle.index(start_from) cycle = cycle[index:] + cycle[0:index] # append it to result if not already in if cycle not in result: result.append(cycle) return path.append(vertice) try: for node in graph_dict[vertice]: # don't check already visited nodes again if node not in visited: _get_cycles(graph_dict, path, visited, result, node) visited.add(node) except KeyError: pass path.pop()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/graph.py
pylint/graph.py
209
_get_cycles
ref
function
_get_cycles(graph_dict, path, visited, result, node)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
45
Confidence
ref
function
HIGH = Confidence("HIGH", "Warning that is not based on inference result.")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
46
Confidence
ref
function
CONTROL_FLOW = Confidence(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
49
Confidence
ref
function
INFERENCE = Confidence("INFERENCE", "Warning based on inference result.")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
50
Confidence
ref
function
INFERENCE_FAILURE = Confidence(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
53
Confidence
ref
function
UNDEFINED = Confidence("UNDEFINED", "Warning without any associated confidence level.")
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
58
Interface
def
class
is_implemented_by
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
62
is_implemented_by
def
function
def is_implemented_by(cls, instance): return implements(instance, cls)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
63
implements
ref
function
return implements(instance, cls)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
66
implements
def
function
def implements( obj: "BaseChecker", interface: Union[Type["Interface"], Tuple[Type["Interface"], ...]],
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
77
IChecker
def
class
open close
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
83
close
def
function
def close(self): """Called after visiting project (i.e. set of modules)."""
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
87
IRawChecker
def
class
process_module
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
90
process_module
def
function
def process_module(self, node: nodes.Module) -> None: """Process a module. The module's content is accessible via ``astroid.stream`` """
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
97
ITokenChecker
def
class
process_tokens
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
100
process_tokens
def
function
def process_tokens(self, tokens): """Process a module. Tokens is a list of all source code tokens in the file. """
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
107
IAstroidChecker
def
class
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
113
IReporter
def
class
handle_message display_reports
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
116
handle_message
def
function
def handle_message(self, msg) -> None: """Handle the given message object.""" def display_reports(self, layout: "Section") -> None: """Display results encapsulated in the layout tree."""
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/interfaces.py
pylint/interfaces.py
119
display_reports
def
function
def display_reports(self, layout: "Section") -> None: """Display results encapsulated in the layout tree."""
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/__init__.py
pylint/lint/__init__.py
104
Run
ref
function
Run(sys.argv[1:])
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
9
_modpath_from_file
def
function
def _modpath_from_file(filename, is_namespace, path=None): def _is_package_cb(inner_path, parts): return modutils.check_modpath_has_init(inner_path, parts) or is_namespace return modutils.modpath_from_file_with_callback( filename, path=path, is_package_cb=_is_package_cb )
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
10
_is_package_cb
def
function
def _is_package_cb(inner_path, parts): return modutils.check_modpath_has_init(inner_path, parts) or is_namespace return modutils.modpath_from_file_with_callback( filename, path=path, is_package_cb=_is_package_cb )
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
11
check_modpath_has_init
ref
function
return modutils.check_modpath_has_init(inner_path, parts) or is_namespace
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
13
modpath_from_file_with_callback
ref
function
return modutils.modpath_from_file_with_callback(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
18
get_python_path
def
function
def get_python_path(filepath: str) -> str: """TODO This get the python path with the (bad) assumption that there is always an __init__.py. This is not true since python 3.3 and is causing problem. """ dirname = os.path.realpath(os.path.expanduser(filepath)) if not os.path.isdir(dirname): dirname = os.path.dirname(dirname) while _True: if not os.path.exists(os.path.join(dirname, "__init__.py")): return dirname old_dirname = dirname dirname = os.path.dirname(dirname) if old_dirname == dirname: return os.getcwd()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
22
realpath
ref
function
dirname = os.path.realpath(os.path.expanduser(filepath))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
22
expanduser
ref
function
dirname = os.path.realpath(os.path.expanduser(filepath))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
23
isdir
ref
function
if not os.path.isdir(dirname):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
24
dirname
ref
function
dirname = os.path.dirname(dirname)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
26
exists
ref
function
if not os.path.exists(os.path.join(dirname, "__init__.py")):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
29
dirname
ref
function
dirname = os.path.dirname(dirname)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
34
_is_in_ignore_list_re
def
function
def _is_in_ignore_list_re(element: str, ignore_list_re: List[Pattern]) -> bool: """Determines if the element is matched in a regex ignore-list.""" return any(file_pattern.match(element) for file_pattern in ignore_list_re)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
36
match
ref
function
return any(file_pattern.match(element) for file_pattern in ignore_list_re)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
39
expand_modules
def
function
def expand_modules( files_or_modules: List[str], ignore_list: List[str], ignore_list_re: List[Pattern], ignore_list_paths_re: List[Pattern[str]],
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
53
basename
ref
function
basename = os.path.basename(something)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
56
_is_in_ignore_list_re
ref
function
or _is_in_ignore_list_re(os.path.basename(something), ignore_list_re)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
56
basename
ref
function
or _is_in_ignore_list_re(os.path.basename(something), ignore_list_re)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
57
_is_in_ignore_list_re
ref
function
or _is_in_ignore_list_re(something, ignore_list_paths_re)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
60
get_python_path
ref
function
module_path = get_python_path(something)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
62
exists
ref
function
if os.path.exists(something):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
66
modpath_from_file
ref
function
modutils.modpath_from_file(something, path=additional_search_path)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
69
splitext
ref
function
modname = os.path.splitext(basename)[0]
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
70
isdir
ref
function
if os.path.isdir(something):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
78
file_from_modpath
ref
function
filepath = modutils.file_from_modpath(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
88
normpath
ref
function
filepath = os.path.normpath(filepath)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
91
file_info_from_modpath
ref
function
spec = modutils.file_info_from_modpath(
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
97
isdir
ref
function
is_directory = os.path.isdir(something)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
99
is_namespace
ref
function
is_namespace = modutils.is_namespace(spec)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/lint/expand_modules.py
pylint/lint/expand_modules.py
100
is_directory
ref
function
is_directory = modutils.is_directory(spec)