<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_const(self):
 """ Means that value is valid when is equeal to const definition. .. code-block:: python { 'const': 42, } Only valid value is 42 in this example. """

        const = self._definition['const']
        if isinstance(const, str):
            const = '"{}"'.format(const)
        with self.l('if {variable} != {}:', const):
            self.l('raise JsonSchemaException("{name} must be same as const definition")')