code: def expect_iter_end(should_raise, exception_type):
      try:
          yield
      except exception_type:
          if should_raise:
              raise
  
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 5 for calling a global function with example usage: expect_iter_end(should_raise, exception_type) without return types