(self)
Removes the trailing END event if present.

    Should be called before using a sequence to prime generation.
Removes the trailing END event if present.
Removes the trailing END event if present .
def trim_trailing_end_events(self):
    """Removes the trailing END event if present.

    Should be called before using a sequence to prime generation.
    """
    while self._events[-1].event_type == PolyphonicEvent.END:
      del self._events[-1]
def trim_trailing_end_events ( self ) : while self . _events [ - 1 ] . event_type == PolyphonicEvent . END : del self . _events [ - 1 ]