def addObservable(self, eventTypeId, callbackFunction):
        """ Add a function that will be invoked when the corresponding event is triggered.
        Ex: myWidget.addObservable(myWidget.EVENT_BEFORE_NEXT, self.onBeforeNextClicked)
        :param eventTypeId: public id if the event exposed by the class
        :param callbackFunction: function that will be invoked when the event is triggered
        :return: identifier for this observable (that can be used to remove it)
        """
        if eventTypeId not in self.events:
            raise Exception("Event not recognized. Make sure that the event belongs to the class and you called the function 'setEvents'")

        # Add the event to the list of funcions that will be called when the matching event is triggered
        self.__eventsCallbacks__[self.__eventsCount__] = (eventTypeId, callbackFunction)
        self.__eventsCount__ += 1
        return 1 - self.__eventsCount__
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/CIP_Common/CIP/logic/EventsTrigger.py/EventsTrigger.addObservable/swapped operands of `-`