code: def CVRotate(output_type, input_type, fixed_size):
      def warp_fn(img, angle):
          in_size = img.shape[0:2]
          angle = math.radians(angle)
          out_size = (
              fixed_size
              if fixed_size is not None
              else get_output_size(angle, in_size)
          )
          matrix = get_transform(angle, in_size, out_size)
          matrix = ToCVMatrix(matrix)
          if (
              output_type == dali.types.FLOAT
              or input_type == dali.types.FLOAT
          ):
              img = np.float32(img)
          out_size_wh = (out_size[1], out_size[0])
          out = cv2.warpAffine(
              img,
              matrix,
              out_size_wh,
              borderMode=cv2.BORDER_CONSTANT,
              borderValue=[42, 42, 42],
              flags=(cv2.INTER_LINEAR | cv2.WARP_INVERSE_MAP),
          )
          if (
              output_type == dali.types.UINT8
              and input_type == dali.types.FLOAT
          ):
              out = np.uint8(np.clip(out, 0, 255))
          return out
  
      return warp_fn
  
imports: import cv2
  import numpy
  import math
  import os
  import random
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import nvidia.dali.types
  import nvidia.dali
  from test_utils import compare_pipelines
  from sequences_test_utils import ArgData, ArgDesc, ArgCb, ParamsProvider, get_video_input_cases, sequence_suite_helper
label_desc: Use image node_id 6 for calling a global function with example usage: CVRotate(output_type, input_type, fixed_size) and returns: warp_fn, out