code: def test_distance_transform_inplace_indices_errors(self, ndim):
      img = self._binary_image((32,) * ndim, pct_true=80)
      common_kwargs = dict(return_distances=False, return_indices=True)
  
      dt_func = cupyx.scipy.ndimage.distance_transform_edt
  
      # int8 has itemsize too small
      with pytest.raises(RuntimeError):
          indices = cupy.empty((ndim,) + img.shape, dtype=cupy.int8)
          dt_func(img, indices=indices, **common_kwargs)
  
      # float not allowed
      with pytest.raises(RuntimeError):
          indices = cupy.empty((ndim,) + img.shape, dtype=cupy.float64)
          dt_func(img, indices=indices, **common_kwargs)
  
      # wrong shape
      with pytest.raises(RuntimeError):
          indices = cupy.empty((ndim,), dtype=cupy.float32)
          dt_func(img, indices=indices, **common_kwargs)
  
      # can't provide indices array when return_indices is False
      with pytest.raises(RuntimeError):
          indices = cupy.empty((ndim,) + img.shape, dtype=cupy.int32)
          dt_func(img, indices=indices, return_indices=False)
  
imports: import copy
  import numpy
  import pytest
  import cupy
  from cupy import testing
  import cupyx.scipy.ndimage
label_desc: Use image node_id 13 for calling the TestDistanceTransform obj's underlying member method code with example usage: obj.test_distance_transform_inplace_indices_errors(ndim) without return types