code: def test_resample_methods(self, method, ext, padtype, xp, scp):
      # Test resampling of sinusoids and random noise (1-sec)
      rate = 100
      rates_to = [49, 50, 51, 99, 100, 101, 199, 200, 201]
  
      # Sinusoids, windowed to avoid edge artifacts
      t = xp.arange(rate) / float(rate)
      freqs = xp.array((1.0, 10.0, 40.0))[:, xp.newaxis]
      x = xp.sin(2 * xp.pi * freqs * t) * scp.signal.windows.hann(rate)
      results = []
  
      for rate_to in rates_to:
          if method == "fft":
              y_resamps = scp.signal.resample(x, rate_to, axis=-1)
          else:
              if ext and rate_to != rate:
                  # Match default window design
                  g = gcd(rate_to, rate)
                  up = rate_to // g
                  down = rate // g
                  max_rate = max(up, down)
                  f_c = 1.0 / max_rate
                  half_len = 10 * max_rate
                  window = scp.signal.firwin(
                      2 * half_len + 1, f_c, window=("kaiser", 5.0)
                  )
                  polyargs = {"window": window, "padtype": padtype}
              else:
                  polyargs = {"padtype": padtype}
  
              y_resamps = scp.signal.resample_poly(
                  x, rate_to, rate, axis=-1, **polyargs
              )
  
          results.append(y_resamps.copy())
  
      # More tests of fft method (Master 0.18.1 fails these)
      if method == "fft":
          x1 = xp.array([1.0 + 0.0j, 0.0 + 0.0j])
          y1_test = scp.signal.resample(x1, 4)
          x2 = xp.array([1.0, 0.5, 0.0, 0.5])
          y2_test = scp.signal.resample(
              x2, 2
          )  # downsampling a real array
          results.append(y1_test.copy())
          results.append(y2_test.copy())
  
      return results
  
imports: import cupy
  from cupy import testing
  import cupyx.scipy.signal
  import cupyx.scipy.signal.windows
  import numpy
  import pytest
  from math import gcd
label_desc: Use image node_id 8 for calling the TestResample obj's underlying member method code with example usage: obj.test_resample_methods(method, ext, padtype, xp, scp) and returns: results