code: def test_image_generator_function():
      width = 80
      height = 80
  
      tmpdir = tempfile.mkdtemp()
      tmps = []
  
      for i in range(10):
          tmps.append(
              tempfile.NamedTemporaryFile(
                  dir=tmpdir, suffix=".JPEG", delete=False
              )
          )
  
          bytestream = io.BytesIO()
  
          im = Image.new("RGB", (width, height))
          im.save(bytestream, "JPEG")
  
          tmps[i].file.write(bytestream.getvalue())
          tmps[i].flush()
  
      p = Augmentor.Pipeline(tmpdir)
      assert len(p.augmentor_images) == len(tmps)
  
      p.rotate(
          probability=0.5, max_left_rotation=5, max_right_rotation=5
      )
      p.flip_left_right(probability=0.333)
      p.flip_top_bottom(probability=0.5)
  
      g = p.image_generator()
  
      X = next(g)
  
      assert X is not None
  
      # Close all temporary files which will also delete them automatically
      for i in range(len(tmps)):
          tmps[i].close()
  
file_path: Augmentor/tests/test_generators.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from builtins import *
  import os
  import sys
  import Augmentor
  import tempfile
  import io
  import shutil
  import glob
  import random
  import numpy
  from PIL import Image
  from Augmentor import ImageUtilities
label_desc: Use image node_id 1 for calling a global function with example usage: test_image_generator_function() without return types