Back to the room

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

Code Observatory / function

_pad

codeintel.embeddings._pad

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
EmbeddingUnavailableembeddings.pysame file
Called by (4)
SymbolFileResolved by
_edgeembeddings.pysame file
_embedembeddings.pysame file
encode_rawembeddings.pysame file
_encodeembeddings.pysame file
Inside (1)
SymbolFileResolved by
embeddingsembeddings.pysame file
codeintel.embeddings._padbackend/app/codeintel/embeddings.py, lines 64–72Open source
def _pad(vec: Sequence[float], dim: int) -> list[float]:    vec = [float(v) for v in vec]    if len(vec) == dim:        return vec    if len(vec) > dim:        raise EmbeddingUnavailable(            f"model produces {len(vec)}-dim vectors; the index column holds {dim}"        )    return vec + [0.0] * (dim - len(vec))

What the index recorded

Signature
def _pad(vec: Sequence[float], dim: int) -> list[float]:
File
backend/app/codeintel/embeddings.py
Lines
64–72
Parser
python-ast
Git blob
df7f8202f23ca6ad2c57aca5f09b435eb6486d79
Call sites
3 named, 1 resolved, 2 left unlinked
Outside this subset
1 more edges reach code outside the graph shown here

Read it on GitHub at this commit