code: def external_source_tester_multiple(
      start_values, input_names, batches
  ):
      def get_external_source_pipeline_getter(
          batch_size,
          num_threads,
          device,
          device_id=0,
          shard_id=0,
          num_shards=1,
          def_for_dataset=False,
      ):
          sources = [
              InfiniteSampleIterator(start_value)
              for start_value in start_values
          ]
          output_shapes = [
              ((batch_size,) + tuple(None for _ in start_value.shape))
              for start_value in start_values
          ]
          output_shapes = tuple(output_shapes + output_shapes)
          output_dtypes = tuple(
              [
                  tf.dtypes.as_dtype(start_value.dtype)
                  for start_value in start_values
              ]
              + [tf.int32] * len(start_values)
          )
  
          pipe = many_input_pipeline(
              def_for_dataset,
              device,
              sources,
              input_names,
              batch_size=batch_size,
              num_threads=num_threads,
              device_id=device_id,
              batches=batches,
          )
  
          return pipe, output_shapes, output_dtypes
  
      return get_external_source_pipeline_getter
  
imports: import numpy
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.plugin.tf
  import tensorflow
  from nose.tools import nottest
  from nvidia.dali import pipeline_def
  from test_utils import RandomlyShapedDataIterator
label_desc: Use image node_id 8 for calling a global function with example usage: external_source_tester_multiple(start_values, input_names, batches) and returns: get_external_source_pipeline_getter, pipe,  output_shapes,  output_dtypes