code: def testMelodyRNNPipeline(self):
      note_sequence = magenta.common.testing_lib.parse_test_proto(
          note_seq.NoteSequence,
          """
          time_signatures: {
            numerator: 4
            denominator: 4}
          tempos: {
            qpm: 120}""",
      )
      note_seq.testing_lib.add_track_to_sequence(
          note_sequence,
          0,
          [
              (12, 100, 0.00, 2.0),
              (11, 55, 2.1, 5.0),
              (40, 45, 5.1, 8.0),
              (55, 120, 8.1, 11.0),
              (53, 99, 11.1, 14.1),
          ],
      )
      note_seq.testing_lib.add_chords_to_sequence(
          note_sequence, [("N.C.", 0.0), ("Am9", 5.0), ("D7", 10.0)]
      )
  
      quantizer = note_sequence_pipelines.Quantizer(steps_per_quarter=4)
      lead_sheet_extractor = lead_sheet_pipelines.LeadSheetExtractor(
          min_bars=7,
          min_unique_pitches=5,
          gap_bars=1.0,
          ignore_polyphonic_notes=False,
          all_transpositions=False,
      )
      conditional_encoding = (
          note_seq.ConditionalEventSequenceEncoderDecoder(
              note_seq.OneHotEventSequenceEncoderDecoder(
                  note_seq.MajorMinorChordOneHotEncoding()
              ),
              note_seq.OneHotEventSequenceEncoderDecoder(
                  note_seq.MelodyOneHotEncoding(
                      self.config.min_note, self.config.max_note
                  )
              ),
          )
      )
      quantized = quantizer.transform(note_sequence)[0]
      lead_sheet = lead_sheet_extractor.transform(quantized)[0]
      lead_sheet.squash(
          self.config.min_note,
          self.config.max_note,
          self.config.transpose_to_key,
      )
      encoded = pipelines_common.make_sequence_example(
          *conditional_encoding.encode(
              lead_sheet.chords, lead_sheet.melody
          )
      )
      expected_result = {
          "training_lead_sheets": [encoded],
          "eval_lead_sheets": [],
      }
  
      pipeline_inst = improv_rnn_pipeline.get_pipeline(
          self.config, eval_ratio=0.0
      )
      result = pipeline_inst.transform(note_sequence)
      self.assertEqual(expected_result, result)
  
file_path: magenta/magenta/models/improv_rnn/improv_rnn_create_dataset_test.py
imports: import magenta
  from magenta.contrib import training
  from magenta.models.improv_rnn import improv_rnn_model
  from magenta.models.improv_rnn import improv_rnn_pipeline
  from magenta.pipelines import lead_sheet_pipelines
  from magenta.pipelines import note_sequence_pipelines
  from magenta.pipelines import pipelines_common
  import note_seq
  import note_seq.testing_lib
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the ImprovRNNPipelineTest obj's underlying member method code with example usage: obj.testMelodyRNNPipeline() without return types