@classmethod
def _escape_dict_keys(cls, data: dict) ->dict:
    """Recursively escape all keys in a dict."""
    ret = {}
    for key, value in data.items():
        key = cls._escape_key(key)
        if isinstance(value, dict):
            value = cls._escape_dict_keys(value)
        ret[key] = value
    return ret
