code: def test_poly_vs_filtfilt(self, xp, scp):
      # Check that up=1.0 gives same answer as filtfilt + slicing
      # random_state = xp.random.RandomState(17)
      try_types = (int, xp.float32, xp.complex64, float, complex)
      size = 10000
      down_factors = [2, 11, 79]
      results = []
  
      for dtype in try_types:
          x = testing.shaped_random((size,), xp, dtype, scale=1.0)
          # x = random_state.randn(size).astype(dtype)
          if dtype in (xp.complex64, xp.complex128):
              x += 1j * testing.shaped_random(
                  (size,), xp, xp.float32, scale=1.0
              )
  
          # resample_poly assumes zeros outside of signl, whereas filtfilt
          # can only constant-pad. Make them equivalent:
          x[0] = 0
          x[-1] = 0
  
          for down in down_factors:
              h = scp.signal.firwin(31, 1.0 / down, window="hamming")
  
              # Need to pass convolved version of filter to resample_poly,
              # since filtfilt does forward and backward, but resample_poly
              # only goes forward
              hc = scp.signal.convolve(h, h[::-1])
              y = scp.signal.resample_poly(x, 1, down, window=hc)
              results.append(y)
      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 9 for calling the TestResample obj's underlying member method code with example usage: obj.test_poly_vs_filtfilt(xp, scp) and returns: results