class_docstr: Convert between performance event indices and (filenames of) MIDI files.
class_docstr_tok: ["Convert","between","performance","event","indices","and","(","filenames","of",")","MIDI","files","."]
docstr: Transform a sequence of event indices into a performance NoteSequence.
  
  Args:
    ids: List of performance event indices.
    strip_extraneous: Whether to strip EOS and padding from the end of `ids`.
  
  Returns:
    A NoteSequence.
code: def decode_to_note_sequence(self, ids, strip_extraneous=False):
      """Transform a sequence of event indices into a performance NoteSequence.
  
      Args:
        ids: List of performance event indices.
        strip_extraneous: Whether to strip EOS and padding from the end of `ids`.
  
      Returns:
        A NoteSequence.
      """
      if strip_extraneous:
          ids = text_encoder.strip_ids(
              ids, list(range(self.num_reserved_ids))
          )
  
      # Decode indices corresponding to event n-grams back into the n-grams.
      event_ids = []
      for i in ids:
          if i >= self.unigram_vocab_size:
              event_ids += self._ngrams[i - self.unigram_vocab_size]
          else:
              event_ids.append(i)
  
      performance = note_seq.Performance(
          quantized_sequence=None,
          steps_per_second=self._steps_per_second,
          num_velocity_bins=self._num_velocity_bins,
      )
      for i in event_ids:
          performance.append(
              self._encoding.decode_event(i - self.num_reserved_ids)
          )
  
      ns = performance.to_sequence()
  
      return ns
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tempfile
  import note_seq
  from note_seq import performance_lib
  import pygtrie
  from tensor2tensor.data_generators import text_encoder
label_desc: Use image node_id 5 for calling the MidiPerformanceEncoder obj's underlying member method code with example usage: obj.decode_to_note_sequence(ids, strip_extraneous) and returns: ns