18 lines
354 B
Python
18 lines
354 B
Python
import re
|
|
|
|
def boolean_to_int(value: bool) -> int:
|
|
if value:
|
|
return 1
|
|
else:
|
|
return 0
|
|
|
|
def is_float(element: str) -> bool:
|
|
try:
|
|
float(element)
|
|
return True
|
|
except ValueError:
|
|
return False
|
|
|
|
def camel_to_snake(camel_string: str) -> str:
|
|
return re.sub(r'(?<!^)(?=[A-Z])', '_', camel_string).lower()
|