# utils.py import re def fix_key(_key: str) -> str: """ Sanitize a given key by replacing all characters that are not alphanumeric, underscore, hyphen, dot, at symbol, parentheses, plus, equals, semicolon, dollar sign, asterisk, single quote, percent, or colon with an underscore. Args: _key (str): The key to be sanitized. Returns: str: The sanitized key with disallowed characters replaced by underscores. """ return re.sub(r"[^A-Za-z0-9_\-\.@()+=;$!*\'%:]", "_", _key)