def METHOD_NAME(self, node, name, inames, onames, props):
    if not isinstance(node.inputs[0].type, (DenseTensorType, ScalarType)):
        raise NotImplementedError(
            f"CheckAndRaise c_code not implemented for input type {node.inputs[0].type}"
        )
    value_name, *cond_names = inames
    out_name = onames[0]
    check = []
    fail_code = props["fail"]
    param_struct_name = props["params"]
    msg = self.msg.replace('"', '\\"').replace("\n", "\\n")
    for idx, cond_name in enumerate(cond_names):
        if isinstance(node.inputs[0].type, DenseTensorType):
            check.append(
                f"""
        if(PyObject_IsTrue((PyObject *){cond_name}) == 0) {{
            PyObject * exc_type = {param_struct_name}->exc_type;
            Py_INCREF(exc_type);
            PyErr_SetString(exc_type, "{msg}");
            Py_XDECREF(exc_type);
            {indent(fail_code, " " * 4)}
        }}
                """
            )
        else:
            check.append(
                f"""
        if({cond_name} == 0) {{
            PyObject * exc_type = {param_struct_name}->exc_type;
            Py_INCREF(exc_type);
            PyErr_SetString(exc_type, "{msg}");
            Py_XDECREF(exc_type);
            {indent(fail_code, " " * 4)}
        }}
                """
            )
    check = "\n".join(check)
    if isinstance(node.inputs[0].type, DenseTensorType):
        res = f"""
        {check}
        Py_XDECREF({out_name});
        {out_name} = {value_name};
        Py_INCREF({value_name});
        """
    else:
        res = f"""
        {check}
        {out_name} = {value_name};
        """
    return res