MCPcopy Create free account
hub / github.com/23japhone/HALO / extract_python_code_block

Function extract_python_code_block

utils/basic_operation.py:242–247  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

240
241
242def extract_python_code_block(text: str) -> str:
243 pattern = r"```python(.*?)```"
244 match = re.search(pattern, text, re.DOTALL)
245 if match:
246 return match.group(1).strip()
247 return ""
248
249
250def extract_function_body(code: str,

Callers 1

parse_answerMethod · 0.90

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected