<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _on_timeline_update(self, event):
 """Timeline update broadcast from Abode SocketIO server."""

        if isinstance(event, (tuple, list)):
            event = event[0]

        event_type = event.get('event_type')
        event_code = event.get('event_code')

        if not event_type or not event_code:
            _LOGGER.warning("Invalid timeline update event: %s", event)
            return

        _LOGGER.debug("Timeline event received: %s - %s (%s)",
                      event.get('event_name'), event_type, event_code)

        # Compress our callbacks into those that match this event_code
        # or ones registered to get callbacks for all events
        codes = (event_code, TIMELINE.ALL['event_code'])
        all_callbacks = [self._timeline_callbacks[code] for code in codes]

        for callbacks in all_callbacks:
            for callback in callbacks:
                _execute_callback(callback, event)

        # Attempt to map the event code to a group and callback
        event_group = TIMELINE.map_event_code(event_code)

        if event_group:
            for callback in self._event_callbacks.get(event_group, ()):
                _execute_callback(callback, event)