code: def test_swapped_ends():
      data = [np.uint8([1, 2, 3]), np.uint8([1, 2])]
      src = fn.external_source(lambda: data)
      pipe = index_pipe(src, lambda x: x[2:1])
      pipe.build()
      inp, cpu, gpu = pipe.run()
      for i in range(len(inp)):
          x = inp.at(i)
          assert np.array_equal(x[2:1], cpu.at(i))
          assert np.array_equal(x[2:1], gpu.as_cpu().at(i))
  
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 5 for calling a global function with example usage: test_swapped_ends() without return types