MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / extract_code

Function extract_code

scrapegraphai/utils/cleanup_code.py:8–16  ·  view source on GitHub ↗

Module for extracting code

(code: str)

Source from the content-addressed store, hash-verified

6
7
8def extract_code(code: str) -> str:
9 """
10 Module for extracting code
11 """
12 pattern = r"```(?:python)?\n(.*?)```"
13
14 match = re.search(pattern, code, re.DOTALL)
15
16 return match.group(1) if match else code

Callers 5

syntax_reasoning_loopMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected