code: def _check_chainerx_numpy_result_array(
      check_result_func, chainerx_result, numpy_result, indices
  ):
      # Compares `chainerx_result` and `numpy_result` as arrays.
  
      is_chainerx_valid_type = isinstance(
          chainerx_result, chainerx.ndarray
      )
      is_numpy_valid_type = _is_numpy_type(numpy_result)
  
      if not (is_chainerx_valid_type and is_numpy_valid_type):
          raise _ResultsCheckFailure(
              "Using decorator without returning ndarrays. "
              "If you want to explicitly ignore certain tests, "
              "return chainerx.testing.ignore() to avoid this error",
              indices,
          )
  
      if chainerx_result.shape != numpy_result.shape:
          raise _ResultsCheckFailure(
              "Shape mismatch",
              indices,
              lambda np_r, chx_r: (
                  "chainerx: {}, numpy: {}".format(
                      chx_r.shape, np_r.shape
                  )
              ),
          )
  
      if chainerx_result.device is not chainerx.get_default_device():
          raise _ResultsCheckFailure(
              "ChainerX bad device",
              indices,
              lambda np_r, chx_r: (
                  "default: {}, chainerx: {}".format(
                      chainerx.get_default_device(), chx_r.device
                  )
              ),
          )
  
      try:
          check_result_func(chainerx_result, numpy_result)
      except AssertionError as e:
          # Convert AssertionError to _ResultsCheckFailure
          raise _ResultsCheckFailure(str(e), indices)
  
imports: import functools
  import traceback
  import warnings
  import numpy
  import pytest
  import chainerx
  from chainerx.testing import array
label_desc: Use image node_id 5 for calling a global function with example usage: _check_chainerx_numpy_result_array(check_result_func, chainerx_result, numpy_result, indices) without return types