class_docstr: Iterator yielding data from a Numpy array.
  
  # Arguments
      x: Numpy array of input data or tuple.
          If tuple, the second elements is either
          another numpy array or a list of numpy arrays,
          each of which gets passed
          through as an output without any modifications.
      y: Numpy array of targets data.
      image_data_generator: Instance of `ImageDataGenerator`
          to use for random transformations and normalization.
      batch_size: Integer, size of a batch.
      shuffle: Boolean, whether to shuffle the data between epochs.
      sample_weight: Numpy array of sample weights.
      seed: Random seed for data shuffling.
      data_format: String, one of `channels_first`, `channels_last`.
      save_to_dir: Optional directory where to save the pictures
          being yielded, in a viewable format. This is useful
          for visualizing the random transformations being
          applied, for debugging purposes.
      save_prefix: String prefix to use for saving sample
          images (if `save_to_dir` is set).
      save_format: Format to use for saving sample images
          (if `save_to_dir` is set).
      subset: Subset of data (`"training"` or `"validation"`) if
          validation_split is set in ImageDataGenerator.
      ignore_class_split: Boolean (default: False), ignore difference
              in number of classes in labels across train and validation
              split (useful for non-classification tasks)
      dtype: Dtype to use for the generated arrays.
code: def _get_batches_of_transformed_samples(self, index_array):
      batch_x = np.zeros(
          tuple([len(index_array)] + list(self.x.shape)[1:]),
          dtype=self.dtype,
      )
      for i, j in enumerate(index_array):
          x = self.x[j]
          params = self.image_data_generator.get_random_transform(
              x.shape
          )
          x = self.image_data_generator.apply_transform(
              x.astype(self.dtype), params
          )
          x = self.image_data_generator.standardize(x)
          batch_x[i] = x
  
      if self.save_to_dir:
          for i, j in enumerate(index_array):
              img = array_to_img(
                  batch_x[i], self.data_format, scale=True
              )
              fname = "{prefix}_{index}_{hash}.{format}".format(
                  prefix=self.save_prefix,
                  index=j,
                  hash=np.random.randint(1e4),
                  format=self.save_format,
              )
              img.save(os.path.join(self.save_to_dir, fname))
      batch_x_miscs = [xx[index_array] for xx in self.x_misc]
      output = (
          batch_x if batch_x_miscs == [] else [batch_x] + batch_x_miscs,
      )
      if self.y is None:
          return output[0]
      output += (self.y[index_array],)
      if self.sample_weight is not None:
          output += (self.sample_weight[index_array],)
      return output
  
file_path: keras-preprocessing/keras_preprocessing/image/numpy_array_iterator.py
imports: import os
  import warnings
  import numpy
  from .iterator import Iterator
  from .utils import array_to_img
label_desc: Use image node_id 3 for calling the NumpyArrayIterator obj's underlying member method code with example usage: obj._get_batches_of_transformed_samples(index_array) and returns: output, output