def setValue(self, newValue, repaintIsNotNeeded=None):
        if repaintIsNotNeeded is not None and repaintIsNotNeeded is True:
            # Check that value from changeVariables() doesn't contain unallowed
            # selections: In the multi select mode, the user has selected or
            # deselected a disabled item. In the single select mode, the user
            # has selected a disabled item.
            if self.isMultiSelect():
                currentValueSet = self.getValue()
                newValueSet = newValue
                for itemId in currentValueSet:
                    if (not self.isItemEnabled(itemId)
                            and not (itemId in newValueSet)):
                        self.requestRepaint()
                        return

                for itemId in newValueSet:
                    if (not self.isItemEnabled(itemId)
                            and not (itemId in currentValueSet)):
                        self.requestRepaint()
                        return
            else:
                if newValue is None:
                    newValue = self.getNullSelectionItemId()

                if not self.isItemEnabled(newValue):
                    self.requestRepaint()
                    return

        super(OptionGroup, self).setValue(newValue, repaintIsNotNeeded)
dataset/ETHPy150Open rwl/muntjac/muntjac/ui/option_group.py/OptionGroup.setValue/original