@staticmethod
def create_event_list(ll_ref, ll_hyp, time_threshold=0.01):
    """
        Create an event list of all labels.

        Arguments:
            ll_ref (LabelList): Reference labels.
            ll_hyp (LabelList): Hypothesis labels.
            time_threshold (float): If two event times are closer than this threshold the time of the
                                    earlier event is used for both events.

        Returns:
            list: List of list of tuples. Every tuple contains a time, type (start or end), ll_index (ref/hyp) and
            the label which is responsible for the event. It is sorted ascending by time.
        """
    events = []
    for label in ll_ref:
        events.append((label.start, 'S', 0, label))
        events.append((label.end, 'E', 0, label))
    for label in ll_hyp:
        events.append((label.start, 'S', 1, label))
        events.append((label.end, 'E', 1, label))
    events = sorted(events, key=lambda x: x[0])
    time_grouped = []
    current_group = events[0][0], [events[0]]
    for i in range(1, len(events)):
        if abs(events[i][0] - events[i - 1][0]) < time_threshold:
            current_group[1].append(events[i])
        else:
            time_grouped.append(current_group)
            current_group = events[i][0], [events[i]]
    time_grouped.append(current_group)
    return time_grouped
