MCPcopy
hub / github.com/deepseek-ai/DeepSeek-Coder / _fix_a_slash_b

Function _fix_a_slash_b

Evaluation/PAL-Math/utils/parser.py:40–54  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

38
39
40def _fix_a_slash_b(string):
41 if len(string.split("/")) != 2:
42 return string
43 a = string.split("/")[0]
44 b = string.split("/")[1]
45 try:
46 if "sqrt" not in a:
47 a = int(a)
48 if "sqrt" not in b:
49 b = int(b)
50 assert string == "{}/{}".format(a, b)
51 new_string = "\\frac{" + str(a) + "}{" + str(b) + "}"
52 return new_string
53 except:
54 return string
55
56
57def _fix_sqrt(string):

Callers 1

strip_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected