code: def check_slice_named_args_default_start_or_end(device, batch_size):
      test_data_shape = [5, 4, 3]
  
      def get_data():
          out = [
              np.random.randint(
                  0, 255, size=test_data_shape, dtype=np.uint8
              )
              for _ in range(batch_size)
          ]
          return out
  
      pipe = Pipeline(batch_size=batch_size, num_threads=4, device_id=0)
      with pipe:
          data = fn.external_source(source=get_data, layout="HWC")
          in_shape = np.array([5, 4])
          start = np.array([1, 2])
          shape = np.array([3, 1])
          end = start + shape
          outs = [
              fn.slice(data, start=start, end=in_shape, axes=(0, 1)),
              fn.slice(data, start=[0, 0], end=end, axes=(0, 1)),
              fn.slice(data, start=start, axes=(0, 1)),
              fn.slice(data, end=end, axes=(0, 1)),
          ]
          pipe.set_outputs(*outs)
      pipe.build()
      for _ in range(3):
          outs = pipe.run()
          for sample in range(batch_size):
              np.testing.assert_equal(
                  np.array(outs[0][sample]), np.array(outs[2][sample])
              )
              np.testing.assert_equal(
                  np.array(outs[1][sample]), np.array(outs[3][sample])
              )
  
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 17 for calling a global function with example usage: check_slice_named_args_default_start_or_end(device, batch_size) and returns: out