code: def abs_slice_start_and_end(
      in_shape,
      slice_anchor,
      slice_shape,
      normalized_anchor,
      normalized_shape,
  ):
      ndim = len(in_shape)
      if normalized_anchor and normalized_shape:
          start = [
              roundint(in_shape[i] * np.float64(slice_anchor[i]))
              for i in range(ndim)
          ]
          end = [
              roundint(
                  in_shape[i]
                  * np.float64(slice_anchor[i] + slice_shape[i])
              )
              for i in range(ndim)
          ]
      else:
          if normalized_anchor:
              start = [
                  roundint(in_shape[i] * np.float64(slice_anchor[i]))
                  for i in range(ndim)
              ]
          else:
              start = [roundint(slice_anchor[i]) for i in range(ndim)]
  
          if normalized_shape:
              end = [
                  start[i]
                  + roundint(in_shape[i] * np.float64(slice_shape[i]))
                  for i in range(ndim)
              ]
          else:
              end = [
                  start[i] + roundint(slice_shape[i])
                  for i in range(ndim)
              ]
      out_shape = [end[i] - start[i] for i in range(ndim)]
      return start, end, out_shape
  
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 2 for calling a global function with example usage: abs_slice_start_and_end(in_shape, slice_anchor, slice_shape, normalized_anchor, normalized_shape) and returns: start,  end,  out_shape