(s)
| 6 | import re |
| 7 | |
| 8 | def extract_number(s): |
| 9 | if isinstance(s, str): |
| 10 | # Use regular expression to find all numbers in the text |
| 11 | numbers = re.findall(r"\b\d+(?:\.\d+)?\b", s) |
| 12 | # Convert the extracted strings to floats or integers |
| 13 | ls = [float(num) if "." in num else int(num) for num in numbers] |
| 14 | |
| 15 | return ls[0] if ls else None |
| 16 | |
| 17 | if isinstance(s, int) or isinstance(s, float): |
| 18 | return s |
| 19 | |
| 20 | try: |
| 21 | NODE_BIN = os.environ.get("NODE_BIN") or ( |