Back to the room

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

Code Observatory / method

encode_raw

codeintel.embeddings.EdgeFirstEmbedder.encode_raw

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 (1)
SymbolFileResolved by
_edgeembeddings.pysame file
Inside (1)
SymbolFileResolved by
EdgeFirstEmbedderembeddings.pysame file
codeintel.embeddings.EdgeFirstEmbedder.encode_rawbackend/app/codeintel/embeddings.py, lines 429–440Open source
    def encode_raw(self, texts: list[str]) -> list[list[float]]:        if time.monotonic() >= self._skip_until:            try:                vectors = self._edge(texts)                self.edge_calls += 1                return vectors            except Exception as exc:  # timeout, connection refused, bad answer                self._skip_until = time.monotonic() + self.retry_after                logger.warning("edge embedding unavailable (%s); using the local model for %ss",                               type(exc).__name__, self.retry_after)        self.local_calls += 1        return self.local.encode_raw(texts)

What the index recorded

Signature
def encode_raw(self, texts: list[str]) -> list[list[float]]:
File
backend/app/codeintel/embeddings.py
Lines
429–440
Parser
python-ast
Git blob
df7f8202f23ca6ad2c57aca5f09b435eb6486d79
Call sites
5 named, 2 resolved, 3 left unlinked
Outside this subset
1 more edges reach code outside the graph shown here

Read it on GitHub at this commit