'Returns a SequenceExample for the given event sequence pair.
Args:
control_events: A list-like sequence of control events.
target_events: A list-like sequence of target events, the same length as
`control_events`.
Returns:
A tf.train.SequenceExample containing inputs and labels.
Raises:
ValueError: If the control and target event sequences have different
length.'

def encode(self, control_events, target_events):

    if (len(control_events) != len(target_events)):
        raise ValueError(('must    have    the    same    number    of    control    and    target    events    (%d    control    events    but    %d    target    events)' % (len(control_events), len(target_events))))
    inputs = []
    labels = []
    for i in range((len(target_events) - 1)):
        inputs.append(self.events_to_input(control_events, target_events, i))
        labels.append(self.events_to_label(target_events, (i + 1)))
    return sequence_example_lib.make_sequence_example(inputs, labels)
