              logger.debug("Setting preview feed: (side: '%s')", side)
              preview_images = self._config.get("preview_images", 14)
              preview_images = min(max(preview_images, 2), 16)
              batchsize = min(len(self._images[side]), preview_images)
              retval[side] = self._load_generator(idx).minibatch_ab(self._images[side],
                                                                    batchsize,
                                                                    side,
                                                                    do_shuffle=True,
                                                                    is_preview=True)
          logger.debug("Set preview feed. Batchsize: %s", batchsize)
          return retval
  
      def get_batch(self):
          """ Get the feed data and the targets for each training side for feeding into the model's
          train function.
 
</s> remove             preview_images = self._config.get("preview_images", 14)
 </s> add             preview_images = int(self._config.get("preview_images", 14)) </s> remove         retval = {}
        for idx, side in enumerate(("a", "b")):
 </s> add         retval: Dict[Literal["a", "b"], Generator[BatchType, None, None]] = {}
        for side in get_args(Literal["a", "b"]): </s> remove     def get_batch(self):
 </s> add     def get_batch(self) -> Tuple[List[List[np.ndarray]], ...]: </s> remove         for idx, side in enumerate(("a", "b")):
            self._display_feeds["timelapse"][side] = self._load_generator(idx).minibatch_ab(
                images[side][:batch_size],
                batch_size,
                side,
                do_shuffle=False,
                is_timelapse=True)
 </s> add         # MyPy can't recurse into nested dicts to get the type :(
        iterator = cast(Dict[Literal["a", "b"], Generator[BatchType, None, None]],
                        self._display_feeds["timelapse"])

        for side in get_args(Literal["a", "b"]):
            imgs = images[side]
            logger.debug("Setting preview feed: (side: '%s', images: %s)", side, len(imgs))

            iterator[side] = self._load_generator(side,
                                                  True,
                                                  batch_size=batch_size,
                                                  images=imgs).minibatch_ab() </s> remove             The side ("a" or "b") as key, :class:`~lib.training_data.TrainingDataGenerator` as
 </s> add             The side ("a" or "b") as key, :class:`~lib.training_data.PreviewDataGenerator` as
            retval[side] = self._load_generator(side,
                                                True,
                                                batch_size=batchsize).minibatch_ab()
              logger.debug("Setting preview feed: (side: '%s')", side)
              preview_images = self._config.get("preview_images", 14)
              preview_images = min(max(preview_images, 2), 16)
              batchsize = min(len(self._images[side]), preview_images)
            retval[side] = self._load_generator(side,
                                                True,
                                                batch_size=batchsize).minibatch_ab()
            retval[side] = self._load_generator(side,
                                                True,
                                                batch_size=batchsize).minibatch_ab()
            retval[side] = self._load_generator(side,
                                                True,
                                                batch_size=batchsize).minibatch_ab()
            retval[side] = self._load_generator(side,
                                                True,
                                                batch_size=batchsize).minibatch_ab()
            retval[side] = self._load_generator(side,
                                                True,
                                                batch_size=batchsize).minibatch_ab()
            retval[side] = self._load_generator(side,
                                                True,
                                                batch_size=batchsize).minibatch_ab()
          return retval
  
      def get_batch(self):
          """ Get the feed data and the targets for each training side for feeding into the model's
          train function.
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Data Augmentation update (#1263)

- lib.detected_face
    - Subclass Masks for Landmark based masks
    - Add training mask propery + methods to DetectedFace
  - lib.training_training
    - subclass TrainingDataGenerator for training and preview data
    - Split cache into own module
    - Reduce thread count to 1 to prevent image corruption + data re-use
    - Process on largest model input/output size rather than stored image size
    - Size and crop masks during caching stage
    - Implement ring buffer for data flow
    - Fix preview reload bug
  - augmentation
    - typing
    - switch color aug order
    - better initialization
    - Fix warp + landmark warp to correctly apply at different image scales
    - Slightly improved warp caching
    - Don't store whether image is_preview. Handle all data as training images implicitly
  - plugins.trainer: Typing and fixes to work with trainingdata refactor 
plugins/train/trainer/_base.py