(content: str, max_length: int = MAX_LENGTH_TRUNCATE_CONTENT)
| 255 | |
| 256 | |
| 257 | def truncate_content(content: str, max_length: int = MAX_LENGTH_TRUNCATE_CONTENT) -> str: |
| 258 | if len(content) <= max_length: |
| 259 | return content |
| 260 | else: |
| 261 | return ( |
| 262 | content[: max_length // 2] |
| 263 | + f"\n..._This content has been truncated to stay below {max_length} characters_...\n" |
| 264 | + content[-max_length // 2 :] |
| 265 | ) |
| 266 | |
| 267 | |
| 268 | class ImportFinder(ast.NodeVisitor): |
no outgoing calls
no test coverage detected
searching dependent graphs…