import re from typing import Optional def camel_to_snake(string: Optional[str]) -> str: if not string: return string return re.sub(r"(?