code: def _test_vs_open_cv(
      device,
      batch_size,
      window_size,
      in_type,
      out_type,
      normalize,
      grayscale,
  ):
      pipe = laplacian_pipe(
          device_id=0,
          device=device,
          num_threads=4,
          batch_size=batch_size,
          window_size=window_size,
          in_type=in_type,
          out_type=out_type,
          normalize=normalize,
          grayscale=grayscale,
      )
      pipe.build()
      norm_factor = normalization_factor(window_size)
      scale = 1 if not normalize else norm_factor
      for _ in range(test_iters):
          edges, imgs = pipe.run()
          if device == "gpu":
              edges = edges.as_cpu()
              imgs = imgs.as_cpu()
          imgs = to_batch(imgs, batch_size)
          baseline_cv = laplacian_cv(
              imgs, window_size, in_type, out_type, scale, grayscale
          )
          edges = to_batch(edges, batch_size)
          actual_out_type = (
              out_type if out_type is not None else in_type
          )
          assert len(edges) == len(baseline_cv)
          if actual_out_type == types.FLOAT:
              max_error = 1e-7 if window_size <= 11 else 1e-4
          else:
              max_error = 1
          # values in the array raise exponentially with the window_size, so without normalization
          # the absolute error will also be big - normalize the values before the comparison
          if not normalize:
              edges = [a * norm_factor for a in edges]
              baseline_cv = [a * norm_factor for a in baseline_cv]
          check_batch(
              edges,
              baseline_cv,
              batch_size,
              max_allowed_error=max_error,
              expected_layout="HWC",
          )
  
imports: from nvidia.dali.pipeline import pipeline_def
  import nvidia.dali.types
  import nvidia.dali.fn
  import numpy
  import cv2
  from scipy.ndimage import convolve1d, filters
  import os
  from nose_utils import assert_raises
  from nose.plugins.attrib import attr
  from sequences_test_utils import video_suite_helper, ArgCb
  from test_utils import get_dali_extra_path, check_batch, RandomlyShapedDataIterator
label_desc: Use image node_id 7 for calling a global function with example usage: _test_vs_open_cv(device, batch_size, window_size, in_type, out_type, normalize, grayscale) without return types