code: def run_and_compare_with_layout(batch_gen, pipe):
      for _ in range(batch_gen.num_iter()):
          output = pipe.run()
          assert (
              output[0].layout() == output[1].layout()
          ), f"{output[0].layout()} vs {output[1].layout()}"
          reduced = output[0].as_array()
          reduced_by_name = output[1].as_array()
  
          assert np.array_equal(reduced, reduced_by_name)
  
imports: import nvidia.dali.fn
  from nvidia.dali.pipeline import Pipeline
  from nose.tools import nottest
  import numpy
  from test_utils import np_type_to_dali
  from nose_utils import assert_raises
label_desc: Use image node_id 17 for calling a global function with example usage: run_and_compare_with_layout(batch_gen, pipe) without return types