from typing import Union
def try_float(value: str) -> Union[int, float, str]:
try:
return float(value)
except:
pass
return int(value)
raise ValueError(f"Could not convert {value} to float or int")
# return value