code: def check_wrong_axes(device, wrong_axes_range=None, named_args=False):
      @pipeline_def(batch_size=1, num_threads=1, device_id=0)
      def make_pipe():
          fake_data = types.Constant(
              0, shape=[10, 10, 3], dtype=types.FLOAT, device=device
          )
          axes = fn.random.uniform(
              range=wrong_axes_range, shape=(2,), dtype=types.INT32
          )
          rel_start = fn.random.uniform(
              range=[0.0, 0.3], shape=(2,), dtype=types.FLOAT
          )
          rel_shape = fn.random.uniform(
              range=[0.4, 0.6], shape=(2,), dtype=types.FLOAT
          )
          if named_args:
              sliced = fn.slice(
                  fake_data,
                  rel_start=rel_start,
                  rel_shape=rel_shape,
                  axes=axes,
              )
          else:
              sliced = fn.slice(
                  fake_data, rel_start, rel_shape, axes=axes
              )
          return sliced
  
      p = make_pipe()
      p.build()
      # Note: [[] and []] are '[' and ']' characters.
      assert_raises(
          RuntimeError,
          p.run,
          glob="Axis * out of range. Expected range is [[]-3, 2[]] for a 3D input",
      )
  
imports: from nvidia.dali import Pipeline, pipeline_def, ops, fn, types
  import numpy
  import os
  from functools import partial
  from math import floor
  from test_utils import compare_pipelines, get_dali_extra_path, RandomDataIterator, generator_random_axes_for_3d_input, generator_random_data, as_array
  from nose_utils import assert_raises
  from nose2.tools import params
label_desc: Use image node_id 28 for calling a global function with example usage: check_wrong_axes(device, wrong_axes_range, named_args) and returns: sliced