code: def CVWarp(output_type, input_type, warp_matrix=None, inv_map=False):
      def warp_fn(img, matrix):
          size = (320, 240)
          matrix = ToCVMatrix(matrix)
          if output_type == types.FLOAT or input_type == types.FLOAT:
              img = np.float32(img)
  
          fill = 12.5 if output_type == types.FLOAT else 42
          out = cv2.warpAffine(
              img,
              matrix,
              size,
              borderMode=cv2.BORDER_CONSTANT,
              borderValue=[fill, fill, fill],
              flags=(
                  (cv2.INTER_LINEAR | cv2.WARP_INVERSE_MAP)
                  if inv_map
                  else cv2.INTER_LINEAR
              ),
          )
          if output_type == types.UINT8 and input_type == types.FLOAT:
              out = np.uint8(np.clip(out, 0, 255))
          return out
  
      if warp_matrix:
          m = np.array(warp_matrix)
  
          def warp_fixed(img):
              return warp_fn(img, m)
  
          return warp_fixed
  
      return warp_fn
  
imports: import nose_utils
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import nvidia.dali.fn
  import nvidia.dali.types
  import numpy
  import math
  import os
  import cv2
  from sequences_test_utils import video_suite_helper, SampleDesc, ArgCb
  from test_utils import compare_pipelines
  import random
label_desc: Use image node_id 4 for calling a global function with example usage: CVWarp(output_type, input_type, warp_matrix, inv_map) and returns: warp_fn, out, warp_fixed, warp_fn