code: def _impl_generators(
      pred, base_additional_kwargs={}, conditional_additional_kwargs={}
  ):
      test_data_root = get_dali_extra_path()
      caffe_db_folder = os.path.join(test_data_root, "db", "lmdb")
  
      bs = 10
      iters = 5
      kwargs = {
          "batch_size": bs,
          "num_threads": 4,
          "device_id": 0,
          "seed": 42,
      }
  
      @experimental.pipeline_def(**kwargs, **base_additional_kwargs)
      def baseline_pipe():
          encoded, _ = fn.readers.caffe(path=caffe_db_folder, seed=10)
          rand = fn.random.uniform(seed=11)
          predicate = fn.external_source(source=pred, batch=False)
          true_encoded, _ = fn._conditional.split(
              encoded, predicate=predicate
          )
          true_rand, _ = fn._conditional.split(
              rand, predicate=predicate
          )
          # TODO(klecki): Debug mode currently requires explicit constants instantiation
          if base_additional_kwargs:
              u8_zeros = types.Constant(np.uint8([0]), device="cpu")
              f32_zeros = types.Constant(np.float32(0.0), device="cpu")
          else:
              u8_zeros = np.uint8([0])
              f32_zeros = np.float32(0.0)
          _, false_u8 = fn._conditional.split(
              u8_zeros, predicate=predicate
          )
          _, false_f32 = fn._conditional.split(
              f32_zeros, predicate=predicate
          )
          encoded_out = fn._conditional.merge(
              true_encoded, false_u8, predicate=predicate
          )
          rand_out = fn._conditional.merge(
              true_rand, false_f32, predicate=predicate
          )
          return encoded_out, rand_out
  
      @experimental.pipeline_def(
          enable_conditionals=True,
          **kwargs,
          **conditional_additional_kwargs,
      )
      def conditional_pipe():
          predicate = fn.external_source(source=pred, batch=False)
          # Generators work by running in top scope and splitting for particular nesting
          if predicate:
              encoded_out, _ = fn.readers.caffe(
                  path=caffe_db_folder, seed=10
              )
              rand_out = fn.random.uniform(seed=11)
          else:
              encoded_out = types.Constant(np.uint8([0]), device="cpu")
              rand_out = types.Constant(np.float32(0.0), device="cpu")
          return encoded_out, rand_out
  
      pipes = [baseline_pipe(), conditional_pipe()]
      for pipe in pipes:
          pipe.build()
      compare_pipelines(*pipes, bs, iters)
  
imports: from nvidia.dali.pipeline import pipeline_def, experimental
  import nvidia.dali.fn
  import nvidia.dali.types
  from nvidia.dali.types import SampleInfo
  from nvidia.dali import _conditionals
  from nvidia.dali.data_node import DataNode
  import numpy
  import os
  from test_utils import check_batch, compare_pipelines
  from nose_utils import assert_raises
  from test_utils import get_dali_extra_path
  from nose2.tools import params
  import itertools
label_desc: Use image node_id 29 for calling a global function with example usage: _impl_generators(pred, base_additional_kwargs, conditional_additional_kwargs) and returns: encoded_out,  rand_out, encoded_out,  rand_out