MCPcopy Create free account
hub / github.com/Bairong-Xdynamics/MistakeNotebookLearning / should_allow_eval

Function should_allow_eval

examples/utils/grader.py:184–197  ·  view source on GitHub ↗
(expr: str)

Source from the content-addressed store, hash-verified

182
183
184def should_allow_eval(expr: str):
185 # we don't want to try parsing unknown text or functions of more than two variables
186 if count_unknown_letters_in_expr(expr) > 2:
187 return False
188
189 for bad_string in BAD_SUBSTRINGS:
190 if bad_string in expr:
191 return False
192
193 for bad_regex in BAD_REGEXES:
194 if re.search(bad_regex, expr) is not None:
195 return False
196
197 return True
198
199
200def are_equal_under_sympy(ground_truth_normalized: str, given_normalized: str):

Callers 1

are_equal_under_sympyFunction · 0.85

Calls 1

Tested by

no test coverage detected