def set(self, value, execute_command=True):
        """Set current value.

        Parameters
        ==========
        value (bool)
            we set it as the value for this widget;
            that is, if the value is different from the
            current one.
        execute_command (boolean)
            indicates whether to execute the command in
            case the value changes.
        """
        ### ensure value is a boolean

        if not isinstance(value, bool):

            raise TypeError("'value' argument must be of type 'bool'")

        ### store value and update the image, if the value
        ### is different than the current one;
        ###
        ### if it is the case, also execute the command,
        ### if requested

        if value != self.value:

            self.value = value
            self.update_image()

            if execute_command:
                self.command()
Set current value.

        Parameters
        ==========
        value (bool)
            we set it as the value for this widget;
            that is, if the value is different from the
            current one.
        execute_command (boolean)
            indicates whether to execute the command in
            case the value changes.
        
nodezator/widget/checkbutton.py