Extract pure python code from a fenced block.
(text: str)
| 55 | |
| 56 | @staticmethod |
| 57 | def _extract_python_code(text: str) -> str: |
| 58 | """Extract pure python code from a fenced block.""" |
| 59 | if not FinalWriteCode._is_python_code_block(text): |
| 60 | return text |
| 61 | content = text.strip()[len("```python") :].strip() |
| 62 | if content.endswith("```"): |
| 63 | content = content[:-3].strip() |
| 64 | return content |
| 65 | |
| 66 | def _summarize_agent_outputs( |
| 67 | self, |
no test coverage detected