Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
_cosine
codeintel.retrieval._cosine
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
codeintel.retrieval._cosinebackend/app/codeintel/retrieval.py, lines 606–610Open source
def _cosine(a: list[float], b: list[float]) -> float: dot = sum(x * y for x, y in zip(a, b, strict=False)) na = math.sqrt(sum(x * x for x in a)) nb = math.sqrt(sum(y * y for y in b)) return dot / (na * nb) if na and nb else 0.0What the index recorded
- Signature
def _cosine(a: list[float], b: list[float]) -> float:- File
backend/app/codeintel/retrieval.py- Lines
- 606–610
- Parser
- python-ast
- Git blob
884729a39ae0b3d340ad83f75946677dcddf3791- Call sites
- 3 named, 0 resolved, 3 left unlinked
