MCPcopy Create free account
hub / github.com/PRIME-RL/PRIME / is_digit

Function is_digit

data_preprocessing/math_util/grader.py:97–106  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

95
96
97def is_digit(s):
98 try:
99 if "{,}" in str(s):
100 num = float(str(s).replace("{,}", ""))
101 return True, num
102
103 num = float(str(s).replace(",", ""))
104 return True, num
105 except ValueError:
106 return False, None
107
108
109def normalize(answer, pi) -> str:

Callers 1

math_equalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected