MCPcopy Create free account
hub / github.com/Link-AGI/AutoAgents / parse_code

Method parse_code

autoagents/system/utils/common.py:52–59  ·  view source on GitHub ↗
(cls, text: str, lang: str = "")

Source from the content-addressed store, hash-verified

50
51 @classmethod
52 def parse_code(cls, text: str, lang: str = "") -> str:
53 pattern = rf'```{lang}.*?\s+(.*?)```'
54 match = re.search(pattern, text, re.DOTALL)
55 if match:
56 code = match.group(1)
57 else:
58 raise Exception
59 return code
60
61 @classmethod
62 def parse_str(cls, text: str):

Callers

nothing calls this directly

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected