code: def test_generator_with_array_data():
      batch_size = random.randint(1, 100)
      width = 800
      height = 800
  
      image_matrix = np.zeros((100, width, height, 3), dtype="uint8")
      labels = np.zeros(100)
  
      p = Augmentor.Pipeline()
      p.rotate(
          probability=1, max_right_rotation=10, max_left_rotation=10
      )
  
      g = p.keras_generator_from_array(
          image_matrix, labels, batch_size=batch_size, scaled=True
      )
  
      X, y = next(g)
  
      assert len(X) == batch_size
      assert len(y) == batch_size
  
      for i in range(len(y)):
          assert y[i] == 0
  
      for i in range(len(X)):
          x_converted = X[i] * 255
          x_converted = x_converted.astype("uint8")
          im_pil = Image.fromarray(x_converted)
          assert im_pil is not None
  
      image_matrix_2d = np.zeros((100, width, height), dtype="uint8")
      labels_2d = np.zeros(100)
  
      p2 = Augmentor.Pipeline()
      p2.rotate(
          probability=0.1, max_left_rotation=5, max_right_rotation=5
      )
  
      g2 = p2.keras_generator_from_array(
          image_matrix_2d, labels_2d, batch_size=batch_size
      )
  
      X2, y2 = next(g2)
  
      assert len(X2) == batch_size
      assert len(y2) == batch_size
  
      for i in range(len(y2)):
          assert y2[i] == 0
  
      for i in range(len(X2)):
          im_pil = Image.fromarray(X2[i].reshape(width, height))
          assert im_pil is not None
  
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 3 for calling a global function with example usage: test_generator_with_array_data() without return types