code: def generator_fit(
      x: np.ndarray, y: np.ndarray, batch_size: int = 128
  ) -> Iterator[Tuple[np.ndarray, np.ndarray]]:  # pragma: no cover
      """
      Minimal data generator for randomly batching large datasets.
  
      :param x: The data sample to batch.
      :param y: The labels for `x`. The first dimension has to match the first dimension of `x`.
      :param batch_size: The size of the batches to produce.
      :return: A batch of size `batch_size` of random samples from `(x, y)`.
      """
      while True:
          indices = np.random.randint(x.shape[0], size=batch_size)
          yield x[indices], y[indices]
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import os
  import time
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  import six
  from art import config
  from art.estimators.keras import KerasEstimator
  from art.estimators.regression.regressor import RegressorMixin
label_desc: Use image node_id 1 for calling a global function with example usage: generator_fit(x, y, batch_size) without return types