code: def images_from_array(
      x_train,
      y_train,
      validation_data=None,
      val_pct=0.1,
      random_state=None,
      data_aug=None,
      classes=None,
      class_names=None,
      is_regression=False,
  ):
      """
      ```
      Returns image generator (Iterator instance) from training
      and validation data in the form of NumPy arrays.
      This function only supports image classification.
      For image regression, please use images_from_df.
  
      Args:
        x_train(numpy.ndarray):  training gdata
        y_train(numpy.ndarray):  labels must either be:
                                 1. one-hot (or multi-hot) encoded arrays
                                 2. integer values representing the label
        validation_data (tuple): tuple of numpy.ndarrays for validation data.
                                 labels should be in one of the formats listed above.
        val_pct(float): percentage of training data to use for validaton if validation_data is None
        random_state(int): random state to use for splitting data
        data_aug(ImageDataGenerator):  a keras.preprocessing.image.ImageDataGenerator
        classes(str): old name for class_names - should no longer be used
        class_names(str): list of strings to use as class names
        is_regression(bool): If True, task is treated as regression.
                             Used when there is single column of numeric values and
                             numeric values should be treated as numeric targets as opposed to class labels
      Returns:
        batches: a tuple of two image.Iterator - one for train and one for test and ImagePreprocessor instance
      ```
      """
      if classes is not None:
          raise ValueError(
              'Please use class_names argument instead of "classes".'
          )
      if class_names and is_regression:
          warnings.warn(
              "is_regression=True, but class_names is not empty.  Task being treated as regression."
          )
  
      # split out validation set if necessary
      if validation_data:
          x_test = validation_data[0]
          y_test = validation_data[1]
      elif val_pct is not None and val_pct > 0:
          x_train, x_test, y_train, y_test = train_test_split(
              x_train,
              y_train,
              test_size=val_pct,
              random_state=random_state,
          )
      else:
          x_test = None
          y_test = None
  
      # transform labels
      ytrans = U.YTransform(
          class_names=class_names if not is_regression else []
      )
      y_train = ytrans.apply_train(y_train)
      y_test = ytrans.apply_test(y_test)
      class_names = ytrans.get_classes()
  
      # train and test data generators
      (train_datagen, test_datagen) = process_datagen(
          data_aug, train_array=x_train
      )
  
      # Image preprocessor
      preproc = ImagePreprocessor(
          test_datagen, class_names, target_size=None, color_mode=None
      )
  
      # training data
      batches_tr = train_datagen.flow(x_train, y_train, shuffle=True)
  
      # validation data
      batches_te = None
      if x_test is not None and y_test is not None:
          batches_te = test_datagen.flow(x_test, y_test, shuffle=False)
      return (batches_tr, batches_te, preproc)
  
imports: from ..None import utils
  from ..imports import *
  from .preprocessor import ImagePreprocessor
label_desc: Use image node_id 18 for calling a global function with example usage: images_from_array(x_train, y_train, validation_data, val_pct, random_state, data_aug, classes, class_names, is_regression) and returns: batches_tr,  batches_te,  preproc