code: def run_pipeline(pipelines, iterations, device, to_stop_iter=False):
      if not isinstance(pipelines, list):
          pipelines = [pipelines]
      for pipeline in pipelines:
          pipeline.build()
      results = []
      with expect_iter_end(not to_stop_iter, StopIteration):
          for _ in range(iterations):
              shard_outputs = []
              for pipeline in pipelines:
                  pipe_outputs = pipeline.run()
                  shard_outputs.append(
                      tuple(to_array(result) for result in pipe_outputs)
                  )
              results.append(tuple(shard_outputs))
      return results
  
imports: import math
  import numpy
  import nvidia.dali.fn
  import nvidia.dali.plugin.tf
  import nvidia.dali.types
  import os
  import tensorflow
  from contextlib import contextmanager
  from nose import SkipTest
  from nvidia.dali.pipeline import Pipeline
  from tensorflow.python.client import device_lib
  from test_utils import to_array, get_dali_extra_path
label_desc: Use image node_id 14 for calling a global function with example usage: run_pipeline(pipelines, iterations, device, to_stop_iter) and returns: results