Back to the room

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

Code Observatory / function

repositories_matching

codeintel.retrieval.repositories_matching

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

Called by (1)
SymbolFileResolved by
resolve_repositoriescontext.pythrough an import
Inside (1)
SymbolFileResolved by
retrievalretrieval.pysame file
codeintel.retrieval.repositories_matchingbackend/app/codeintel/retrieval.py, lines 614–630Open source
def repositories_matching(db: Session, ref: str | None) -> list[Repository]:    """Resolve a repository reference: id, canonical URL, name or URL suffix."""    if not ref:        return []    ref = ref.strip()    try:        rid = uuid.UUID(ref)        repo = db.get(Repository, rid)        return [repo] if repo else []    except ValueError:        pass    norm = ref.lower().removesuffix(".git").rstrip("/")    repos = db.execute(select(Repository)).scalars().all()    exact = [r for r in repos if r.url.lower() == norm or r.name.lower() == norm]    if exact:        return exact    return [r for r in repos if r.url.lower().endswith("/" + norm) or r.name.lower().endswith("/" + norm)]

What the index recorded

Signature
def repositories_matching(db: Session, ref: str | None) -> list[Repository]:
File
backend/app/codeintel/retrieval.py
Lines
614–630
Parser
python-ast
Git blob
884729a39ae0b3d340ad83f75946677dcddf3791
Call sites
11 named, 2 resolved, 9 left unlinked
Outside this subset
2 more edges reach code outside the graph shown here

Read it on GitHub at this commit