code: def dali_pipe_batch_1(shapes, types, as_single_tuple=False):
      class TestPipeline(pipeline.Pipeline):
          def __init__(self, **kwargs):
              super(TestPipeline, self).__init__(**kwargs)
              self.reader = ops.readers.File(
                  file_root=data_path, file_list=file_list_path
              )
              self.decoder = ops.decoders.Image(device="mixed")
  
          def define_graph(self):
              data, _ = self.reader()
              image = self.decoder(data)
              return image
  
      pipe = TestPipeline(batch_size=1, seed=0)
      ds = dali_tf.DALIDataset(
          pipe, batch_size=1, output_dtypes=types, output_shapes=shapes
      )
      # for clarity, we could have used the previous `pipe`
      pipe_ref = TestPipeline(
          batch_size=1, seed=0, device_id=0, num_threads=4
      )
      pipe_ref.build()
  
      ds_iter = iter(ds)
      # See if the iteration over different images works
      if as_single_tuple:
          shapes = shapes[0]
      for _ in range(10):
          (image,) = ds_iter.next()
          (image_ref,) = pipe_ref.run()
          if shapes is None or len(shapes) == 4:
              assert_equals(image.shape, ([1] + image_ref[0].shape()))
          else:
              assert_equals(image.shape, image_ref[0].shape())
  
imports: import tensorflow
  import nvidia.dali.ops
  import nvidia.dali.pipeline
  import nvidia.dali.plugin.tf
  import nvidia.dali.types
  from test_utils_tensorflow import skip_for_incompatible_tf
  import os
  from nose.tools import assert_equals
  from nose_utils import raises
  import itertools
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: dali_pipe_batch_1(shapes, types, as_single_tuple) and returns: image