(expr: str)
| 189 | |
| 190 | |
| 191 | def should_allow_eval(expr: str): |
| 192 | # we don't want to try parsing unknown text or functions of more than two variables |
| 193 | if count_unknown_letters_in_expr(expr) > 2: |
| 194 | return False |
| 195 | |
| 196 | for bad_string in BAD_SUBSTRINGS: |
| 197 | if bad_string in expr: |
| 198 | return False |
| 199 | |
| 200 | for bad_regex in BAD_REGEXES: |
| 201 | if re.search(bad_regex, expr) is not None: |
| 202 | return False |
| 203 | |
| 204 | return True |
| 205 | |
| 206 | |
| 207 | def are_equal_under_sympy(ground_truth_normalized: str, given_normalized: str): |
no test coverage detected