(content)
| 125 | return code[0] |
| 126 | |
| 127 | def extract_code_from_content2(content): |
| 128 | pattern = r'```python\s*(.*?)```' |
| 129 | result = re.search(pattern, content, re.DOTALL) |
| 130 | |
| 131 | if result: |
| 132 | extracted_code = result.group(1).strip() |
| 133 | else: |
| 134 | extracted_code = "" |
| 135 | print("[WARNING] No Python code found.") |
| 136 | return extracted_code |
| 137 | |
| 138 | def format_json_data(data): |
| 139 | formatted_text = "" |