Back to the room

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

Code Observatory / function

symbol_like_terms

codeintel.retrieval.symbol_like_terms

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 (2)
SymbolFileResolved by
compound_nameretrieval.pysame file
searchretrieval.pysame file
Called by (1)
SymbolFileResolved by
_symbol_boostretrieval.pysame file
Inside (1)
SymbolFileResolved by
retrievalretrieval.pysame file
codeintel.retrieval.symbol_like_termsbackend/app/codeintel/retrieval.py, lines 169–188Open source
def symbol_like_terms(query: str) -> set[str]:    """Compound names the query spells out as identifiers.    Only tokens written in code form (``verify_password``, ``TokenSigner.verify``,    ``parseURL``, ``issue()``) — or the whole query when it is at most two    words — count. A natural-language query that merely contains a word that    happens to be a class name ("weight of a parcel" vs ``Parcel``) does not.    """    raw = re.findall(r"[A-Za-z_][\w.]*(?:\(\))?", query)    out: set[str] = set()    for tok in raw:        tok = tok.rstrip(".")  # a sentence's full stop is not a member access        if _IDENTIFIER_SHAPE_RE.search(tok):            for part in tok.rstrip("()").split("."):                if compound_name(part):                    out.add(compound_name(part))    words = query.split()    if 0 < len(words) <= 2 and compound_name("_".join(words)):        out.add(compound_name("_".join(words)))    return out

What the index recorded

Signature
def symbol_like_terms(query: str) -> set[str]:
File
backend/app/codeintel/retrieval.py
Lines
169–188
Parser
python-ast
Git blob
884729a39ae0b3d340ad83f75946677dcddf3791
Call sites
9 named, 2 resolved, 7 left unlinked
Outside this subset
2 more edges reach code outside the graph shown here

Read it on GitHub at this commit