def decode_and_deserialize(
    json_string, module_objects=None, custom_objects=None
):
    """Decodes the JSON and deserializes any Keras objects found in the dict."""
    return json.loads(
        json_string,
        object_hook=functools.partial(
            _decode_helper,
            deserialize=True,
            module_objects=module_objects,
            custom_objects=custom_objects,
        ),
    )
Decodes the JSON and deserializes any Keras objects found in the dict.
keras/src/legacy/saving/json_utils.py