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 symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| resolve_repositories | context.py | through an import |
| Symbol | File | Resolved by |
|---|---|---|
| retrieval | retrieval.py | same 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
