MCPcopy Create free account
hub / github.com/CloudOrc/SolidUI / extract_code

Function extract_code

solidui/views/utils.py:26–33  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

24
25
26def extract_code(text):
27 triple_match = re.search(r'```(?:\w+\n)?(.+?)```', text, re.DOTALL)
28 if triple_match:
29 return triple_match.group(1).strip()
30 single_match = re.search(r'`(.+?)`', text, re.DOTALL)
31 if single_match:
32 return single_match.group(1).strip()
33 return text
34
35
36async def send_request_and_process_response(url, headers, data, type_name, process_response_func):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected