code: def test_samplerate_hopsize(self, hop_size, samplerate, soundfile):
      orig_samplerate = parse_file_samplerate(soundfile)
      try:
          if (
              orig_samplerate is not None
              and orig_samplerate < samplerate
          ):
              # upsampling should emit a warning
              with assert_warns(UserWarning):
                  f = source(soundfile, samplerate, hop_size)
          else:
              f = source(soundfile, samplerate, hop_size)
      except RuntimeError as e:
          err_msg = (
              "failed opening with hop_s={:d}, samplerate={:d} ({:s})"
          )
          skipTest(err_msg.format(hop_size, samplerate, str(e)))
      assert f.samplerate != 0
      read_frames = self.read_from_source(f)
      if "f_" in soundfile and samplerate == 0:
          import re
  
          f = re.compile(r".*_\([0:9]*f\)_.*")
          match_f = re.findall("([0-9]*)f_", soundfile)
          if len(match_f) == 1:
              expected_frames = int(match_f[0])
              assert_equal(expected_frames, read_frames)
  
imports: from numpy.testing import TestCase, assert_equal
  from aubio import source
  from utils import list_all_sounds, parse_file_samplerate
  import unittest
  from _tools import assert_raises, assert_equal, assert_warns
  from _tools import parametrize, skipTest
label_desc: Use image node_id 2 for calling the Test_aubio_source_read obj's underlying member method code with example usage: obj.test_samplerate_hopsize(hop_size, samplerate, soundfile) without return types