def callback_register(self, name, cb):
        """ Registers a callback on a name.
            name: a name string
            cb: a callback of CalvinCB or CalvinCBGroup type
        """
        if self.__callback_valid_names is None or name in self.__callback_valid_names:
            if name not in self.__callbacks:
                self.__callbacks[name] = {}
            self.__callbacks[name][cb.id] = cb
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/utilities/calvin_callback.py/CalvinCBClass.callback_register/original