code: def check_conditional_split_merge(dev, pred_gen):
      bs = 10
      kwargs = {
          "batch_size": bs,
          "num_threads": 4,
          "device_id": 0,
          "prefetch_queue_depth": 1,  # so that it's easier to use external source
      }
      pipe_sm = conditional_split_merge_pipe(dev, **kwargs)
      pipe_true = rotate_pipe(dev, **kwargs)
      pipe_false = flip_pipe(dev, **kwargs)
      pipe_sm.build()
      pipe_true.build()
      pipe_false.build()
      data_iter = RandomlyShapedDataIterator(
          bs, min_shape=(20, 20, 3), max_shape=(40, 30, 3)
      )
      data_iter = iter(data_iter)
      for _ in range(test_iters):
          predicate = [pred_gen(i) for i in range(bs)]
          data = next(data_iter)
          data_true = [data[i] for i in range(bs) if predicate[i]]
          data_false = [data[i] for i in range(bs) if not predicate[i]]
          pipe_sm.feed_input("input", data)
          pipe_sm.feed_input("predicate", predicate)
          if data_true:
              pipe_true.feed_input("input", data_true)
              (out_true,) = pipe_true.run()
          else:
              out_true = []
          if data_false:
              pipe_false.feed_input("input", data_false)
              (out_false,) = pipe_false.run()
          else:
              out_false = []
          (out,) = pipe_sm.run()
          out_baseline = []
          idx_true = 0
          idx_false = 0
          for p in predicate:
              if p:
                  out_baseline.append(out_true[idx_true])
                  idx_true = idx_true + 1
              else:
                  out_baseline.append(out_false[idx_false])
                  idx_false = idx_false + 1
          if dev == "gpu":
              out = [out[i].as_cpu() for i in range(bs)]
              out_baseline = [
                  out_baseline[i].as_cpu() for i in range(bs)
              ]
          check_batch(out, out_baseline, bs)
  
file_path: DALI/dali/test/python/operator_2/test_split_merge.py
imports: from nvidia.dali.pipeline import pipeline_def, Pipeline
  import nvidia.dali.fn
  import nvidia.dali.types
  import numpy
  from test_utils import check_batch, RandomlyShapedDataIterator
  from nose_utils import assert_raises
  from nose2.tools import params
label_desc: Use image node_id 5 for calling a global function with example usage: check_conditional_split_merge(dev, pred_gen) without return types