code: def check_transform_rotation_op(
      angle=None,
      axis=None,
      center=None,
      has_input=False,
      reverse_order=False,
      batch_size=1,
      num_threads=4,
      device_id=0,
  ):
      assert axis is None or len(axis) == 3
      ndim = 3 if axis is not None else 2
      assert center is None or len(center) == ndim
      random_angle = angle is None
  
      pipe = Pipeline(
          batch_size=batch_size,
          num_threads=num_threads,
          device_id=device_id,
          seed=12345,
      )
      with pipe:
          outputs = []
          if random_angle:
              angle = fn.random.uniform(range=(-90, 90))
  
          if has_input:
              T0 = fn.random.uniform(
                  range=(-1, 1), shape=(ndim, ndim + 1)
              )
              T1 = fn.transforms.rotation(
                  T0,
                  device="cpu",
                  angle=angle,
                  axis=axis,
                  center=center,
                  reverse_order=reverse_order,
              )
              outputs = [T1, T0]
          else:
              T1 = fn.transforms.rotation(
                  device="cpu", angle=angle, axis=axis, center=center
              )
              outputs = [T1]
  
          if random_angle:
              outputs.append(angle)
  
          pipe.set_outputs(*outputs)
      pipe.build()
      outs = pipe.run()
      out_idx = 1
      out_T0 = None
      out_angle = None
      if has_input:
          out_T0 = outs[out_idx]
          out_idx = out_idx + 1
      if random_angle:
          out_angle = outs[out_idx]
          out_idx = out_idx + 1
      for idx in range(batch_size):
          T0 = out_T0.at(idx) if has_input else None
          angle = out_angle.at(idx) if random_angle else angle
          ref_mat = rotate_affine_mat(
              angle=angle, axis=axis, center=center
          )
          check_results_sample(
              outs[0].at(idx), ref_mat, T0, reverse_order, atol=1e-6
          )
  
imports: import random
  import warnings
  import numpy
  from scipy.spatial.transform import Rotation
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops.transforms
  import nvidia.dali.ops
  import nvidia.dali.fn
  from nvidia.dali import pipeline_def
  from sequences_test_utils import ArgData, ArgDesc, sequence_suite_helper, ArgCb, ParamsProvider
  from nose_utils import assert_raises
label_desc: Use image node_id 10 for calling a global function with example usage: check_transform_rotation_op(angle, axis, center, has_input, reverse_order, batch_size, num_threads, device_id) without return types