code: def _test_fn_rotate(device):
      pipe = Pipeline(batch_size=1, num_threads=1, device_id=0)
  
      image = np.array(
          [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], dtype=np.uint8
      )[:, :, np.newaxis]
      batch = [image]
  
      input = fn.external_source([batch], layout="HWC")
      rotated = fn.rotate(
          input.gpu() if device == "gpu" else input, angle=90
      )
      pipe.set_outputs(rotated)
  
      pipe.build()
      outs = pipe.run()
      out = outs[0] if device == "cpu" else outs[0].as_cpu()
      arr = out.at(0)
      ref = np.array([[4, 8, 12], [3, 7, 11], [2, 6, 10], [1, 5, 9]])[
          :, :, np.newaxis
      ]
      assert np.array_equal(arr, ref)
  
imports: import nvidia.dali.fn
  import nvidia.dali.ops
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.types
  import numpy
  from nose_utils import assert_raises
  import sys
  import inspect
  from nose.plugins.attrib import attr
  import nose
label_desc: Use image node_id 1 for calling a global function with example usage: _test_fn_rotate(device) without return types