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

Function _fix_sqrt

data_preprocessing/math_util/math_normalize.py:81–93  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

79
80
81def _fix_sqrt(string):
82 if "\\sqrt" not in string:
83 return string
84 splits = string.split("\\sqrt")
85 new_string = splits[0]
86 for split in splits[1:]:
87 if split[0] != "{":
88 a = split[0]
89 new_substr = "\\sqrt{" + a + "}" + split[1:]
90 else:
91 new_substr = "\\sqrt" + split
92 new_string += new_substr
93 return new_string
94
95
96def _strip_string(string):

Callers 1

_strip_stringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected