Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
_resolve_relative
codeintel.parsers.python_parser._resolve_relative
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 symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| visit_ImportFrom | python_parser.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| python_parser | python_parser.py | same file |
codeintel.parsers.python_parser._resolve_relativebackend/app/codeintel/parsers/python_parser.py, lines 37–49Open source
def _resolve_relative(module_path: str, is_package: bool, level: int, module: str | None) -> str: """Absolute module name for ``from <level dots><module> import …``.""" base = module_path.split(".") if module_path else [] # For a module, level 1 means "my package" (drop the module itself); # for a package's __init__, level 1 means the package itself. drop = level - 1 if is_package else level if drop > len(base): base = [] elif drop: base = base[: len(base) - drop] if module: base = base + module.split(".") return ".".join(base)What the index recorded
- Signature
def _resolve_relative(module_path: str, is_package: bool, level: int, module: str | None) -> str:- File
backend/app/codeintel/parsers/python_parser.py- Lines
- 37–49
- Parser
- python-ast
- Git blob
63495bcda67d5742151d40ab76540e513f44e088- Call sites
- 3 named, 0 resolved, 3 left unlinked
