code: def ColorTwistPipeline(
      data_iterator, is_input_float, inp_dtype, out_dtype
  ):
      imgs = fn.external_source(source=data_iterator)
      o_dtype = dali_type_to_np(out_dtype)
      # converting float inputs to integer outs leads to binary images as
      # input is in -1 to 1 range in such case
      if is_input_float and not np.issubdtype(o_dtype, np.floating):
          imgs *= 255
      H = fn.random.uniform(range=[-20, 20])
      S = fn.random.uniform(range=[0, 2])
      brightness = fn.random.uniform(range=[0, 2])
      contrast = fn.random.uniform(range=[0, 2])
  
      out_dtype_arg = out_dtype if out_dtype != inp_dtype else None
      out_cpu, out_gpu = (
          fn.color_twist(
              input,
              hue=H,
              saturation=S,
              brightness=brightness,
              contrast=contrast,
              dtype=out_dtype_arg,
          )
          for input in (imgs, imgs.gpu())
      )
      return imgs, out_cpu, out_gpu, H, S, brightness, contrast
  
file_path: DALI/dali/test/python/operator_1/test_color_twist.py
imports: import math
  import numpy
  import nvidia.dali.fn
  import nvidia.dali.types
  import random
  from nvidia.dali import pipeline_def
  from sequences_test_utils import ArgCb, video_suite_helper
  from test_utils import RandomDataIterator
label_desc: Use image node_id 2 for calling a global function with example usage: ColorTwistPipeline(data_iterator, is_input_float, inp_dtype, out_dtype) and returns: imgs,  out_cpu,  out_gpu,  H,  S,  brightness,  contrast