- Fixed TypeError caused by invalid use of typing.Optional with two arguments.
Replaced Optional[Dict[str, Any], None] with correct Optional[Dict[str, Any]] = None.
- Updated __escape_match() to pass integer brace counts instead of raw strings
to _n_brackets_after_escape_for_existing_key, preventing runtime errors.
- Converted regex patterns to raw strings (r\'...\') to eliminate SyntaxWarning
about invalid escape sequences (\\s, \\{).