def METHOD_NAME(clazz):
    clazz.catalogue_name = property(lambda inst: name)
    clazz.eg_shape = property(lambda inst: input_shape)
    clazz.eg_compile = property(lambda inst: compile_args)
    clazz.eg_x = property(lambda inst: X)
    clazz.eg_y = property(lambda inst: Y)
    @keras_model_fns(name)
    def create_component(*call_args, **call_kwargs):
        return clazz(*call_args, **call_kwargs)
    # Capture construction args and store them on the instance
    wrapped_init = clazz.__init__
    def __init__(self, *args, **kwargs):
        wrapped_init(self, *args, **kwargs)
        try:
            srsly.json_dumps(args)
            srsly.json_dumps(kwargs)
        except BaseException as _err:
            raise ValueError(
                "In order to serialize Keras Subclass models, the constructor "
                "arguments must be serializable. This allows thinc to recreate "
                "the code-based model with the same configuration.\n"
                f"The encountered error is: {_err}"
            )
        self.eg_args = ArgsKwargs(args, kwargs)
    clazz.__init__ = __init__
    return clazz