MCPcopy Index your code
hub / github.com/going-doer/Paper2Code / extract_code_from_content

Function extract_code_from_content

codes/utils.py:119–125  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

117 return result
118
119def extract_code_from_content(content):
120 pattern = r'^```(?:\w+)?\s*\n(.*?)(?=^```)```'
121 code = re.findall(pattern, content, re.DOTALL | re.MULTILINE)
122 if len(code) == 0:
123 return ""
124 else:
125 return code[0]
126
127def extract_code_from_content2(content):
128 pattern = r'```python\s*(.*?)```'

Callers 3

3.1_coding_sh.pyFile · 0.90
3_coding.pyFile · 0.90
3_coding_llm.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected