MCPcopy
hub / github.com/imoneoi/openchat / _str_is_int

Function _str_is_int

ochat/evaluation/grading/math_grader.py:69–75  ·  view source on GitHub ↗
(x: str)

Source from the content-addressed store, hash-verified

67
68
69def _str_is_int(x: str) -> bool:
70 try:
71 x = _strip_properly_formatted_commas(x)
72 x = float(x)
73 return abs(x - int(round(x))) <= 1e-7
74 except:
75 return False
76
77
78def _str_to_int(x: str) -> bool:

Callers 2

_normalizeFunction · 0.85
grade_answerFunction · 0.85

Calls 1

Tested by

no test coverage detected