code: def _check_chainerx_numpy_error(
      chainerx_error,
      chainerx_tb,
      numpy_error,
      numpy_tb,
      accept_error=(),
  ):
      # TODO(sonots): Change error class names of ChainerX to be similar with
      # NumPy, and check names.
      if chainerx_error is None and numpy_error is None:
          pytest.fail(
              "Both chainerx and numpy are expected to raise errors, but not"
          )
      elif chainerx_error is None:
          pytest.fail("Only numpy raises error\n\n" + numpy_tb)
      elif numpy_error is None:
          pytest.fail("Only chainerx raises error\n\n" + chainerx_tb)
      elif not (
          isinstance(chainerx_error, accept_error)
          and isinstance(numpy_error, accept_error)
      ):
          msg = """Both chainerx and numpy raise exceptions
  
  chainerx
  %s
  numpy
  %s
  """ % (
              chainerx_tb,
              numpy_tb,
          )
          pytest.fail(msg)
  
imports: import functools
  import traceback
  import warnings
  import numpy
  import pytest
  import chainerx
  from chainerx.testing import array
label_desc: Use image node_id 3 for calling a global function with example usage: _check_chainerx_numpy_error(chainerx_error, chainerx_tb, numpy_error, numpy_tb, accept_error) without return types