Back to the room

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

Code Observatory / function

_python_module_index

codeintel.graph._python_module_index

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._python_module_indexbackend/app/codeintel/graph.py, lines 78–89Open source
def _python_module_index(modules: list[ChunkNode]) -> dict[str, list[ChunkNode]]:    """Map every dotted suffix of a module path to its module chunk(s).    ``src.pkg.db`` is reachable as ``src.pkg.db``, ``pkg.db`` and ``db`` so    that src-layout and namespace packages resolve.    """    index: dict[str, list[ChunkNode]] = defaultdict(list)    for mod in modules:        parts = mod.qualified_name.split(".")        for i in range(len(parts)):            index[".".join(parts[i:])].append(mod)    return index

What the index recorded

Signature
def _python_module_index(modules: list[ChunkNode]) -> dict[str, list[ChunkNode]]:
File
backend/app/codeintel/graph.py
Lines
78–89
Parser
python-ast
Git blob
3791a0283d18722675047af567570cb2c1911c63
Call sites
6 named, 0 resolved, 6 left unlinked

Read it on GitHub at this commit