'Returns a SequenceExample for the given event sequence.
Args:
events: A list-like sequence of events.
Returns:
A tf.train.SequenceExample containing inputs and labels.'

def encode(self, events):

    inputs = []
    labels = []
    for i in range((len(events) - 1)):
        inputs.append(self.events_to_input(events, i))
        labels.append(self.events_to_label(events, (i + 1)))
    return sequence_example_lib.make_sequence_example(inputs, labels)
