(expr: str)
| 182 | |
| 183 | |
| 184 | def 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 | |
| 200 | def are_equal_under_sympy(ground_truth_normalized: str, given_normalized: str): |
no test coverage detected