def METHOD_NAME(self, source, future_target, past_target):
    if self.targets is not None:
        target = []
        if self.add_eos_for_other_targets and (('self' in self.targets) or ('past' in self.targets)) \
                and source[-1] != self.vocab.eos():
            # append eos at the end of source
            source = torch.cat([source, source.new([self.vocab.eos()])])
            if 'future' in self.targets:
                future_target = torch.cat([future_target, future_target.new([self.vocab.pad()])])
            if 'past' in self.targets:
                # first token is before the start of sentence which is only used in "none" break mode when
                # add_eos_for_other_targets is False
                past_target = torch.cat([past_target.new([self.vocab.pad()]), past_target[1:], source[-2, None]])
        for t in self.targets:
            if t == 'self':
                target.append(source)
            elif t == 'future':
                target.append(future_target)
            elif t == 'past':
                target.append(past_target)
            else:
                raise Exception('invalid target ' + t)
        if len(target) == 1:
            target = target[0]
    else:
        target = future_target
    return source, self._filter_vocab(target)