Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / method

visit_ImportFrom

codeintel.parsers.python_parser._Extractor.visit_ImportFrom

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Calls (2)
SymbolFileResolved by
add_identifierbase.pyunique name
_resolve_relativepython_parser.pysame file
Inside (1)
SymbolFileResolved by
_Extractorpython_parser.pysame file
codeintel.parsers.python_parser._Extractor.visit_ImportFrombackend/app/codeintel/parsers/python_parser.py, lines 177–192Open source
    def visit_ImportFrom(self, node: ast.ImportFrom) -> None:        if node.level:            base = _resolve_relative(self.module_path, self.is_package, node.level, node.module)        else:            base = node.module or ""        if base:            self.imports.append(base)        for alias in node.names:            if alias.name == "*":                continue            target = f"{base}.{alias.name}" if base else alias.name            # "from pkg import mod" may import a submodule; record it too.            self.imports.append(target)            local = alias.asname or alias.name            self.import_map[local] = target            self.current.add_identifier(local)

What the index recorded

Signature
def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
File
backend/app/codeintel/parsers/python_parser.py
Lines
177–192
Parser
python-ast
Git blob
63495bcda67d5742151d40ab76540e513f44e088
Call sites
3 named, 2 resolved, 1 left unlinked

Read it on GitHub at this commit