code: def _test_too_many_indices(device):
      data = [np.uint8([1, 2, 3]), np.uint8([1, 2])]
      src = fn.external_source(lambda: data, device=device)
      pipe = index_pipe(src, lambda x: x[1, :])
  
      # Verified by tensor_subscript
      with assert_raises(RuntimeError, glob="Too many indices"):
          pipe.build()
          _ = pipe.run()
  
      # Verified by subscript_dim_check
      pipe = index_pipe(src, lambda x: x[:, :])
      with assert_raises(RuntimeError, glob="Too many indices"):
          pipe.build()
          _ = pipe.run()
  
      # Verified by expand_dims
      pipe = index_pipe(src, lambda x: x[:, :, dali.newaxis])
      with assert_raises(RuntimeError, glob="not enough dimensions"):
          pipe.build()
          _ = pipe.run()
  
      # Verified by subscript_dim_check
      pipe = index_pipe(
          src, lambda x: x[dali.newaxis, :, dali.newaxis, :]
      )
      with assert_raises(RuntimeError, glob="Too many indices"):
          pipe.build()
          _ = pipe.run()
  
imports: from nvidia import dali
  from nvidia.dali import fn
  import numpy
  from nvidia.dali.pipeline import Pipeline
  from nose_utils import assert_raises
label_desc: Use image node_id 15 for calling a global function with example usage: _test_too_many_indices(device) without return types