code: def testMixSequencesNormalize(self):
      sample_rate = 10
  
      sequence1 = music_pb2.NoteSequence()
      sequence1.notes.add(
          pitch=60, start_time=0.5, end_time=1.0, velocity=32
      )
      sequence1.notes.add(
          pitch=62, start_time=1.0, end_time=2.0, velocity=64
      )
      sequence1.total_time = 2.0
  
      samples1 = np.linspace(
          0, 0.5, int(sample_rate * sequence1.total_time)
      )
  
      sequence2 = music_pb2.NoteSequence()
      sequence2.notes.add(
          pitch=64, start_time=0.5, end_time=1.0, velocity=90
      )
      sequence2.total_time = 1.0
  
      samples2 = np.linspace(
          0, 1, int(sample_rate * sequence2.total_time)
      )
  
      (
          mixed_samples,
          mixed_sequence,
      ) = audio_label_data_utils.mix_sequences(
          [samples1, samples2], sample_rate, [sequence1, sequence2]
      )
  
      expected_sequence = music_pb2.NoteSequence()
      expected_sequence.ticks_per_quarter = constants.STANDARD_PPQ
      expected_sequence.notes.add(
          pitch=60, start_time=0.5, end_time=1.0, velocity=63
      )
      expected_sequence.notes.add(
          pitch=62, start_time=1.0, end_time=2.0, velocity=127
      )
      expected_sequence.notes.add(
          pitch=64, start_time=0.5, end_time=1.0, velocity=127
      )
      expected_sequence.notes.add(
          pitch=64, start_time=1.5, end_time=2.0, velocity=127
      )
      expected_sequence.total_time = 2.0
  
      self.assertProtoEquals(expected_sequence, mixed_sequence)
  
      samples1_normalized = samples1 * 2  # previous max was .5
      expected_samples = (
          np.concatenate([samples2, samples2]) * 0.5
          + samples1_normalized * 0.5
      )
      np.testing.assert_array_equal(expected_samples, mixed_samples)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from magenta.models.onsets_frames_transcription import audio_label_data_utils
  from note_seq import audio_io
  from note_seq import constants
  from note_seq import testing_lib
  from note_seq.protobuf import music_pb2
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the MixSequencesTest obj's underlying member method code with example usage: obj.testMixSequencesNormalize() without return types