MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / is_float

Function is_float

text2motion/utils/get_opt.py:8–18  ·  view source on GitHub ↗
(numStr)

Source from the content-addressed store, hash-verified

6
7
8def is_float(numStr):
9 flag = False
10 numStr = str(numStr).strip().lstrip('-').lstrip('+')
11 try:
12 reg = re.compile(r'^[-+]?[0-9]+\.[0-9]+$')
13 res = reg.match(str(numStr))
14 if res:
15 flag = True
16 except Exception as ex:
17 print("is_float() - error: " + str(ex))
18 return flag
19
20
21def is_number(numStr):

Callers 1

get_optFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected