code: def check_ref(inp_dtype, out_dtype, has_3_dims):
      batch_size = 32
      n_iters = 8
      shape = (
          (128, 32, 3)
          if not has_3_dims
          else (random.randint(2, 5), 128, 32, 3)
      )
      inp_dtype = dali_type_to_np(inp_dtype)
      ri1 = RandomDataIterator(batch_size, shape=shape, dtype=inp_dtype)
      pipe = ColorTwistPipeline(
          seed=2139,
          batch_size=batch_size,
          num_threads=4,
          device_id=0,
          data_iterator=ri1,
          is_input_float=np.issubdtype(inp_dtype, np.floating),
          inp_dtype=inp_dtype,
          out_dtype=out_dtype,
      )
      pipe.build()
      for _ in range(n_iters):
          inp, out_cpu, out_gpu, H, S, B, C = pipe.run()
          out_gpu = out_gpu.as_cpu()
          for i in range(batch_size):
              h, s, b, c = H.at(i), S.at(i), B.at(i), C.at(i)
              check(
                  inp.at(i),
                  out_cpu.at(i),
                  out_gpu.at(i),
                  h,
                  s,
                  b,
                  c,
                  dali_type_to_np(out_dtype),
              )
  
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 6 for calling a global function with example usage: check_ref(inp_dtype, out_dtype, has_3_dims) without return types