code: def _contains_nan(x):
      """Returns whether the input array has NaN values.
  
      Args:
          x (numpy.ndarray or cupy.ndarray): Array to be checked.
  
      Returns:
          bool: True if the input has NaN values.
  
      """
      if x.dtype.kind in ("f", "c"):
          device = get_device_from_array(x)
          with chainer.using_device(device):
              return device.xp.isnan(x).any()
      else:
          return False
  
imports: import numpy
  import six
  import chainer
  from chainer.backends import _chainerx
  from chainer.backends import _cpu
  from chainer.backends import cuda
  from chainer.backends import intel64
  import chainerx
  from chainer._backend import Device
  from chainer.backends._chainerx import ChainerxDevice
  from chainer.backends._chainerx import from_chx
  from chainer.backends._chainerx import to_chx
  from chainer.backends._cpu import CpuDevice
  from chainer.backends.cuda import GpuDevice
  from chainer.backends.intel64 import Intel64Device
  from chainer import types
label_desc: Use image node_id 1 for calling a global function with example usage: _contains_nan(x) and returns: False, device