code: def testEncodeNoteSequence(self):
      encoder = music_encoders.TextChordsEncoder(steps_per_quarter=1)
  
      ns = note_seq.NoteSequence()
      ns.tempos.add(qpm=60)
      testing_lib.add_chords_to_sequence(
          ns, [("C", 1), ("Dm", 3), ("Bdim", 4)]
      )
      ns.total_time = 5.0
      ids = encoder.encode_note_sequence(ns)
  
      expected_ids = [
          2,  # no-chord
          3,  # C major
          3,  # C major
          17,  # D minor
          50,  # B diminished
      ]
  
      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 TextChordsEncoderTest obj's underlying member method code with example usage: obj.testEncodeNoteSequence() without return types