code: def testStartPlayback_Updates(self):
      start_time = time.time() + 0.1
      seq = music_pb2.NoteSequence()
      notes = [
          Note(0, 100, start_time, start_time + 101),
          Note(1, 100, start_time, start_time + 101),
      ]
      testing_lib.add_track_to_sequence(seq, 0, notes)
      player = self.midi_hub.start_playback(seq, allow_updates=True)
  
      # Sleep past first note start.
      concurrency.Sleeper().sleep_until(start_time + 0.2)
  
      new_seq = music_pb2.NoteSequence()
      notes = [
          Note(1, 100, 0.0, 0.8),
          Note(2, 100, 0.0, 1.0),
          Note(11, 55, 0.3, 0.5),
          Note(40, 45, 0.4, 0.6),
      ]
      notes = [
          Note(
              note.pitch,
              note.velocity,
              note.start + start_time,
              note.end + start_time,
          )
          for note in notes
      ]
      testing_lib.add_track_to_sequence(new_seq, 0, notes)
      player.update_sequence(new_seq)
  
      # Finish playing sequence.
      concurrency.Sleeper().sleep(0.8)
  
      # Start and end the unclosed note from the first sequence.
      note_events = [
          (start_time, "note_on", 0),
          (start_time + 0.3, "note_off", 0),
      ]
      # The second note will not be played since it started before the update
      # and was not in the original sequence.
      del notes[1]
      for note in notes:
          note_events.append((note.start, "note_on", note.pitch))
          note_events.append((note.end, "note_off", note.pitch))
      note_events = collections.deque(sorted(note_events))
      while not self.port.message_queue.empty():
          msg = self.port.message_queue.get()
          note_event = note_events.popleft()
          self.assertEqual(msg.type, note_event[1])
          self.assertEqual(msg.note, note_event[2])
          self.assertAlmostEqual(msg.time, note_event[0], delta=0.01)
  
      self.assertFalse(note_events)
      player.stop()
  
imports: import collections
  import queue
  import threading
  import time
  from magenta.common import concurrency
  from magenta.interfaces.midi import midi_hub
  import mido
  from note_seq import testing_lib
  from note_seq.protobuf import music_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 11 for calling the MidiHubTest obj's underlying member method code with example usage: obj.testStartPlayback_Updates() without return types