Back to the room

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

Code Observatory / function

_resolve_python_import

codeintel.graph._resolve_python_import

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

Called by (1)
SymbolFileResolved by
build_edgesgraph.pysame file
Inside (1)
SymbolFileResolved by
graphgraph.pysame file
codeintel.graph._resolve_python_importbackend/app/codeintel/graph.py, lines 92–99Open source
def _resolve_python_import(target: str, index: dict[str, list[ChunkNode]]) -> ChunkNode | None:    """Longest dotted prefix of ``target`` that names exactly one module."""    parts = target.split(".")    for end in range(len(parts), 0, -1):        cands = index.get(".".join(parts[:end]))        if cands:            return cands[0] if len(cands) == 1 else None    return None

What the index recorded

Signature
def _resolve_python_import(target: str, index: dict[str, list[ChunkNode]]) -> ChunkNode | None:
File
backend/app/codeintel/graph.py
Lines
92–99
Parser
python-ast
Git blob
3791a0283d18722675047af567570cb2c1911c63
Call sites
5 named, 0 resolved, 5 left unlinked

Read it on GitHub at this commit