code: def testStartCapture_Iterate_Period(self):
      start_time = 1.0
      captor = self.midi_hub.start_capture(
          120,
          start_time,
          stop_signal=midi_hub.MidiSignal(
              type="control_change", control=1
          ),
      )
  
      for msg in self.capture_messages[:-1]:
          threading.Timer(
              0.1 * msg.time, self.port.callback, args=[msg]
          ).start()
  
      period = 0.26
      captured_seqs = []
      wall_start_time = time.time()
      for captured_seq in captor.iterate(period=period):
          if len(captured_seqs) < 2:
              self.assertAlmostEqual(
                  0,
                  (time.time() - wall_start_time) % period,
                  delta=0.01,
              )
          time.sleep(0.1)
          captured_seqs.append(captured_seq)
  
      self.assertLen(captured_seqs, 3)
  
      expected_seq = music_pb2.NoteSequence()
      expected_seq.tempos.add(qpm=120)
      end_time = captured_seqs[0].total_time
      self.assertAlmostEqual(
          wall_start_time + period, end_time, delta=0.01
      )
      expected_seq.total_time = end_time
      testing_lib.add_track_to_sequence(
          expected_seq, 0, [Note(1, 64, 2, end_time)]
      )
      self.assertProtoEquals(captured_seqs[0], expected_seq)
  
      expected_seq = music_pb2.NoteSequence()
      expected_seq.tempos.add(qpm=120)
      end_time = captured_seqs[1].total_time
      self.assertAlmostEqual(
          wall_start_time + 2 * period, end_time, delta=0.01
      )
      expected_seq.total_time = end_time
      testing_lib.add_track_to_sequence(
          expected_seq,
          0,
          [
              Note(1, 64, 2, 5),
              Note(2, 64, 3, 4),
              Note(3, 64, 4, end_time),
          ],
      )
      self.assertProtoEquals(captured_seqs[1], expected_seq)
  
      expected_seq = music_pb2.NoteSequence()
      expected_seq.tempos.add(qpm=120)
      expected_seq.total_time = 6
      testing_lib.add_track_to_sequence(
          expected_seq,
          0,
          [Note(1, 64, 2, 5), Note(2, 64, 3, 4), Note(3, 64, 4, 6)],
      )
      self.assertProtoEquals(captured_seqs[2], expected_seq)
  
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 20 for calling the MidiHubTest obj's underlying member method code with example usage: obj.testStartCapture_Iterate_Period() without return types