code: def test_conditionals():
      tfrecord = os.path.join(
          get_dali_extra_path(), "db", "tfrecord", "train"
      )
      tfrecord_idx = os.path.join(
          get_dali_extra_path(), "db", "tfrecord", "train.idx"
      )
  
      @pipeline_def()
      def get_dali_pipeline(
          tfrec_filenames, tfrec_idx_filenames, shard_id, num_gpus
      ):
          inputs = fn.readers.tfrecord(
              path=tfrec_filenames,
              index_path=tfrec_idx_filenames,
              random_shuffle=True,
              shard_id=shard_id,
              num_shards=num_gpus,
              initial_fill=10000,
              seed=42,
              features={
                  "image/encoded": tfrec.FixedLenFeature(
                      (), tfrec.string, ""
                  ),
                  "image/class/label": tfrec.FixedLenFeature(
                      [1], tfrec.int64, -1
                  ),
                  "image/class/text": tfrec.FixedLenFeature(
                      [], tfrec.string, ""
                  ),
                  "image/object/bbox/xmin": tfrec.VarLenFeature(
                      tfrec.float32, 0.0
                  ),
                  "image/object/bbox/ymin": tfrec.VarLenFeature(
                      tfrec.float32, 0.0
                  ),
                  "image/object/bbox/xmax": tfrec.VarLenFeature(
                      tfrec.float32, 0.0
                  ),
                  "image/object/bbox/ymax": tfrec.VarLenFeature(
                      tfrec.float32, 0.0
                  ),
              },
          )
  
          encoded = inputs["image/encoded"]
          images = fn.decoders.image(
              encoded, device="mixed", output_type=types.RGB
          )
          images = fn.resize(images, device="gpu", resize_shorter=256)
  
          labels = inputs["image/class/label"].gpu()
  
          labels -= 1  # Change to 0-based (don't use background class)
          return images, labels
  
      pipe_base = get_dali_pipeline(
          tfrecord,
          tfrecord_idx,
          shard_id=0,
          num_gpus=1,
          device_id=0,
          num_threads=4,
          batch_size=32,
      )
  
      pipe_cond = get_dali_pipeline(
          tfrecord,
          tfrecord_idx,
          shard_id=0,
          num_gpus=1,
          device_id=0,
          num_threads=4,
          batch_size=32,
          enable_conditionals=True,
      )
      for pipe in [pipe_base, pipe_cond]:
          pipe.build()
      compare_pipelines(pipe_base, pipe_cond, 32, 5)
  
imports: from nvidia.dali import Pipeline, pipeline_def
  import nvidia.dali.ops
  import nvidia.dali.fn
  import nvidia.dali.types
  import nvidia.dali.tfrecord
  import os.path
  import tempfile
  import numpy
  from test_utils import compare_pipelines, get_dali_extra_path
  from nose_utils import assert_raises
  from nose2.tools import cartesian_params
  from nose import SkipTest
label_desc: Use image node_id 14 for calling a global function with example usage: test_conditionals() and returns: images,  labels