Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
with_description
codeintel.text.with_description
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 |
|---|---|---|
| describe_repository | describe.py | through an import |
| Symbol | File | Resolved by |
|---|---|---|
| text | text.py | same file |
codeintel.text.with_descriptionbackend/app/codeintel/text.py, lines 107–114Open source
def with_description(summary: str, description: str) -> str: """Insert ``purpose: <description>`` after the summary's signature and docstring, ahead of the body excerpt (embedders truncate long inputs).""" lines = summary.split("\n") at = 2 if len(lines) > 1 and " :: " in lines[0] else 1 # after the signature, or the header of a block if len(lines) > at and lines[at].startswith(' """'): at += 1 return "\n".join([*lines[:at], f" purpose: {description}", *lines[at:]])What the index recorded
- Signature
def with_description(summary: str, description: str) -> str:- File
backend/app/codeintel/text.py- Lines
- 107–114
- Parser
- python-ast
- Git blob
74781c9c047d5953611fd7634b2cf29e7661b895- Call sites
- 4 named, 0 resolved, 4 left unlinked
- Outside this subset
- 1 more edges reach code outside the graph shown here
