code: def _check_chainerx_numpy_result_impl(
      check_result_func, chainerx_result, numpy_result, indices
  ):
      # This function raises _ResultsCheckFailure if any failure occurs.
      # `indices` is a tuple of indices to reach both `chainerx_results` and
      # `numpy_results` from top-level results.
  
      if (
          chainerx_result is _ignored_result
          and numpy_result is _ignored_result
      ):
          return
  
      if isinstance(chainerx_result, (list, tuple)):
          if type(chainerx_result) is not type(numpy_result):
              raise _ResultsCheckFailure(
                  "Different result types", indices
              )
          if len(chainerx_result) != len(numpy_result):
              raise _ResultsCheckFailure(
                  "Result length mismatch", indices
              )
          for i, (chx_r, np_r) in enumerate(
              zip(chainerx_result, numpy_result)
          ):
              _check_chainerx_numpy_result_impl(
                  check_result_func, chx_r, np_r, indices + (i,)
              )
  
      elif isinstance(chainerx_result, chainerx.ndarray):
          _check_chainerx_numpy_result_array(
              check_result_func, chainerx_result, numpy_result, indices
          )
  
      else:
          if _is_numpy_type(chainerx_result):
              raise _ResultsCheckFailure(
                  "chainerx result should not be a NumPy type", indices
              )
          if type(chainerx_result) != type(numpy_result):
              raise _ResultsCheckFailure("Type mismatch", indices)
          if chainerx_result != numpy_result:
              raise _ResultsCheckFailure("Not equal", 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 6 for calling a global function with example usage: _check_chainerx_numpy_result_impl(check_result_func, chainerx_result, numpy_result, indices) without return types