MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / extract_sql

Function extract_sql

common/common.py:99–111  ·  view source on GitHub ↗
(text, init_sql)

Source from the content-addressed store, hash-verified

97
98
99def extract_sql(text, init_sql):
100 pattern = r'The modified SQL: (.*)'
101
102 result = re.search(pattern, text)
103 if "not an extremum problem" in text:
104 return init_sql
105
106 if result:
107 modified_sql = result.group(1)
108 return modified_sql
109 else:
110 print("No match found.")
111 return init_sql
112
113
114def get_dict_from_str(content):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected