code: def check_write_and_read(
      self, samplerate, channels, hop_size, blocks, write_samples
  ):
      expected_mono = (
          np.sum(write_samples, axis=0) / write_samples.shape[0]
      )
      out = get_tmp_sink_path()
      snk = aubio.sink(out, samplerate, channels=channels)
      for i in range(blocks):
          snk.do_multi(write_samples, hop_size)
      # close the sink before reading from it
      snk.close()
  
      src = aubio.source(out, samplerate, hop_size)
      for i in range(blocks):
          read_samples, read = src.do_multi()
          assert_equal(read_samples, write_samples)
          assert_equal(read, hop_size)
  
      src.seek(0)
      for i in range(blocks):
          read_samples, read = src()
          assert_equal(read, hop_size)
          assert_equal(read_samples, expected_mono)
  
file_path: aubio/python/tests/test_source_channels.py
imports: import os.path
  import unittest
  import aubio
  import numpy
  from numpy.testing import assert_equal
  from utils import get_tmp_sink_path
label_desc: Use image node_id 6 for calling the aubio_source_test_case obj's underlying member method code with example usage: obj.check_write_and_read(samplerate, channels, hop_size, blocks, write_samples) without return types