'Returns the event for the given class index.
This is the reverse process of the self.events_to_label method.
Args:
class_index: An int in the range [0, self.num_classes).
events: The current event sequence.
Returns:
An event value.'

def class_index_to_event(self, class_index, events):

    for (i, lookback_distance) in reversed(list(enumerate(self._lookback_distances))):
        if (class_index == (self._one_hot_encoding.num_classes + i)):
            if (len(events) < lookback_distance):
                return self._one_hot_encoding.default_event
            return events[(- lookback_distance)]
    return self._one_hot_encoding.decode_event(class_index)
