def METHOD_NAME(self, tgt):
    if tgt[-1] != self.eos:
        return tgt
    elif self.silence is None or (len(tgt) > 1 and tgt[-2] == self.silence):
        return tgt[:-1]
    else:
        return tgt[:-1] + [self.silence]