code: def test_run_with_params(
      self, mode, pitchscale, hop_size, samplerate
  ):
      try:
          self.o = aubio.pitchshift(
              mode, pitchscale, hop_size, samplerate
          )
      except RuntimeError as e:
          skipTest("failed creating pitchshift ({})".format(e))
      test_length = self.o.hop_size * 50
      read = 0
      # test on random
      vec = np.random.rand(self.o.hop_size).astype(aubio.float_type)
      transpose_range = self.o.get_transpose()
      while read < test_length:
          # transpose the samples
          out = self.o(vec)
          # position in the file (between 0. and 1.)
          percent_read = read / float(test_length)
          # variable transpose rate (in semitones)
          transpose = (
              transpose_range - 2 * transpose_range * percent_read
          )
          # set transpose rate
          self.o.set_transpose(transpose)
          read += len(vec)
  
file_path: aubio/python/tests/test_pitchshift.py
imports: from numpy.testing import TestCase
  from _tools import parametrize, skipTest
  import numpy
  import aubio
label_desc: Use image node_id 1 for calling the Test_aubio_pitchshift_testruns obj's underlying member method code with example usage: obj.test_run_with_params(mode, pitchscale, hop_size, samplerate) without return types