code: def test_index_with_int_dask_array_indexerror(chunks):
      a = da.arange(4, chunks=chunks, like=cupy.array(()))
      idx = da.from_array([4], chunks=1)
      with pytest.raises(IndexError):
          a[idx].compute()
      idx = da.from_array([-5], chunks=1)
      with pytest.raises(IndexError):
          a[idx].compute()
  
      # CuPy indices
      idx = da.from_array(cupy.array([4]), chunks=1)
      with pytest.raises(IndexError):
          a[idx].compute()
      idx = da.from_array(cupy.array([-5]), chunks=1)
      with pytest.raises(IndexError):
          a[idx].compute()
  
file_path: dask/dask/array/tests/test_cupy_slicing.py
imports: from __future__ import annotations
  import numpy
  import pytest
  import dask.array
  from dask.array.utils import assert_eq
label_desc: Use image node_id 6 for calling a global function with example usage: test_index_with_int_dask_array_indexerror(chunks) without return types