code: def check_equivalence(
      device,
      inp_dtype,
      out_dtype,
      op,
      has_3_dims,
      use_const_contr_center,
  ):
      batch_size = 32
      n_iters = 16
      shape = (
          (128, 32, 3)
          if not has_3_dims
          else (random.randint(2, 5), 128, 32, 3)
      )
      ri1 = RandomDataIterator(
          batch_size, shape=shape, dtype=dali_type_to_np(inp_dtype)
      )
      ri2 = RandomDataIterator(
          batch_size, shape=shape, dtype=dali_type_to_np(inp_dtype)
      )
      contrast_center = (
          None
          if not use_const_contr_center
          else 0.4 * max_range(dali_type_to_np(inp_dtype))
      )
  
      if op == "brightness":
          pipe1 = bri_pipe(
              ri1, out_dtype, device, batch_size=batch_size
          )
      else:
          pipe1 = con_pipe(
              ri1,
              contrast_center,
              out_dtype,
              device,
              batch_size=batch_size,
          )
      bri = op == "brightness"
      con = op == "contrast"
      pipe2 = bricon_pipe(
          ri2,
          contrast_center,
          bri,
          con,
          out_dtype,
          device,
          batch_size=batch_size,
      )
      if out_dtype in [np.half, np.single, np.double]:
          eps = 1e-4
      else:
          eps = 1
      compare_pipelines(pipe1, pipe2, batch_size, n_iters, eps=eps)
  
imports: import nvidia.dali.fn
  from nvidia.dali import pipeline_def
  import nvidia.dali.types
  import numpy
  from test_utils import compare_pipelines, python_function
  from test_utils import RandomDataIterator
  from sequences_test_utils import ArgCb, video_suite_helper
  import random
label_desc: Use image node_id 13 for calling a global function with example usage: check_equivalence(device, inp_dtype, out_dtype, op, has_3_dims, use_const_contr_center) without return types