code: def testEncodeNoteSequence(self):
      encoder = music_encoders.FlattenedTextMelodyEncoderAbsolute(
          steps_per_second=4, num_velocity_bins=127
      )
  
      ns = note_seq.NoteSequence()
      ns.tempos.add(qpm=60)
      testing_lib.add_track_to_sequence(
          ns,
          0,
          [
              (60, 127, 0.0, 0.25),
              (62, 15, 0.25, 0.75),
              (64, 32, 1.25, 2.0),
          ],
      )
      ids = encoder.encode_note_sequence(ns)
      expected_ids = [
          130,  # ON(vel=127)
          18,  # ON(vel=15)
          2,  # HOLD(62)
          2,  # REST
          2,  # REST
          35,  # ON(vel=32)
          2,  # HOLD(64)
          2,  # HOLD(64)
      ]
  
      self.assertEqual(expected_ids, ids)
  
imports: import tempfile
  from magenta.models.score2perf import music_encoders
  import note_seq
  from note_seq import testing_lib
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the FlattenedTextMelodyEncoderTest obj's underlying member method code with example usage: obj.testEncodeNoteSequence() without return types