<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_event_callback(self, event_groups, callback):
 """Register callback for a group of timeline events."""

        if not event_groups:
            return False

        if not isinstance(event_groups, (tuple, list)):
            event_groups = [event_groups]

        for event_group in event_groups:
            if event_group not in TIMELINE.ALL_EVENT_GROUPS:
                raise AbodeException(ERROR.EVENT_GROUP_INVALID,
                                     TIMELINE.ALL_EVENT_GROUPS)

            _LOGGER.debug("Subscribing to event group: %s", event_group)

            self._event_callbacks[event_group].append((callback))

        return True