code: def test_external_source_generator_cycle_error():
      _ = Pipeline(1, 3, 0)
  
      def gen():
          for i in range(5):
              yield [make_array([i + 1.5], dtype=datapy.float32)]
  
      fn.external_source(gen(), cycle=False)  # no cycle - OK
      with assert_raises(
          TypeError,
          glob="Cannot cycle through a generator * pass that function instead as `source`.",
      ):
          fn.external_source(gen(), cycle=True)
  
imports: import functools
  import numpy
  import nvidia.dali.fn
  import nvidia.dali.ops
  from nvidia.dali import Pipeline
  from nose_utils import assert_raises
  from test_utils import check_output
label_desc: Use image node_id 26 for calling a global function with example usage: test_external_source_generator_cycle_error() without return types