Back to the room

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

Code Observatory / class

_Budget

codeintel.context._Budget

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
assemble_contextcontext.pysame file
Contains (1)
SymbolFileResolved by
takecontext.pysame file
Inside (1)
SymbolFileResolved by
contextcontext.pysame file
codeintel.context._Budgetbackend/app/codeintel/context.py, lines 64–79Open source
@dataclassclass _Budget:    limit: int    used: int = 0    truncated: bool = False    def take(self, text: str) -> str | None:        remaining = self.limit - self.used        if remaining <= 0:            self.truncated = True            return None        if len(text) > remaining:            self.truncated = True            text = text[:remaining]        self.used += len(text)        return text

What the index recorded

Signature
class _Budget:
File
backend/app/codeintel/context.py
Lines
64–79
Parser
python-ast
Git blob
0c4a7dd4639651a5c13142d168630e344439f22a

Read it on GitHub at this commit