def METHOD_NAME(self, system=True, display=True):
    try:
        if system:
            caffeine.off()
        else:
            caffeine.on(display)
    except NameError:
        self.log_warning(
            self._("Unable to change power state"), self._("caffeine lib not found")
        )
    except Exception as exc:
        self.log_warning(self._("Unable to change power state"), exc)