code: def test_inf_and_nan(self, xp, scp, dtype):
      import scipy.special  # NOQA
  
      x = numpy.array([-numpy.inf, numpy.nan, numpy.inf]).astype(dtype)
      a = numpy.tile(x, 3)
      b = numpy.repeat(x, 3)
      a = xp.asarray(a)
      b = xp.asarray(b)
      with warnings.catch_warnings():
          warnings.simplefilter("ignore")
          return scp.special.polygamma(a, b)
  
file_path: cupy/tests/cupyx_tests/scipy_tests/special_tests/test_polygamma.py
imports: import unittest
  from cupy import testing
  import cupyx.scipy.special
  import numpy
  import warnings
label_desc: Use image node_id 4 for calling the TestPolygamma obj's underlying member method code with example usage: obj.test_inf_and_nan(xp, scp, dtype) and returns: scp