code: def test_dim_check_fail(arr):
      from pybind11_tests.array import (
          index_at,
          index_at_t,
          offset_at,
          offset_at_t,
          data,
          data_t,
          mutate_data,
          mutate_data_t,
      )
  
      for func in (
          index_at,
          index_at_t,
          offset_at,
          offset_at_t,
          data,
          data_t,
          mutate_data,
          mutate_data_t,
      ):
          with pytest.raises(IndexError) as excinfo:
              func(arr, 1, 2, 3)
          assert (
              str(excinfo.value)
              == "too many indices for an array: 3 (ndim = 2)"
          )
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/deps/pybind11/tests/test_numpy_array.py
imports: import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_dim_check_fail(arr) without return types