code: def check_unary_nan(self, name, xp, dtype):
      a = xp.array(
          [-3, numpy.NAN, -1, numpy.NAN, 0, numpy.NAN, numpy.inf],
          dtype=dtype,
      )
      return getattr(xp, name)(a)
  
file_path: cupy/tests/cupy_tests/logic_tests/test_content.py
imports: import unittest
  import numpy
  from cupy import testing
label_desc: Use image node_id 2 for calling the TestContent obj's underlying member method code with example usage: obj.check_unary_nan(name, xp, dtype) and returns: getattr