      def _process_batch(self, filenames, side):
          """ Performs the augmentation and compiles target images and samples. See
          :func:`minibatch_ab` for more details on the output. """
          logger.trace("Process batch: (filenames: '%s', side: '%s')", filenames, side)
          filenames, batch = read_image_batch(filenames)
          batch = self._apply_mask(filenames, batch, side)
          processed = dict()
  
          # Initialize processing training size on first image
          if not self._processing.initialized:
 
</s> remove     return filenames, batch
 </s> add     return batch </s> remove         batch = []
        filenames = []
 </s> add         batch = [None for _ in range(len(filenames))]
        # There is no guarantee that the same filename will not be passed through multiple times
        # (and when shuffle is true this can definitely happen), so we can't just call
        # filenames.index().
        return_indices = {filename: [idx for idx, fname in enumerate(filenames)
                                     if fname == filename]
                          for filename in set(filenames)} </s> remove             batch.append(future.result())
            filenames.append(images[future])
        batch = np.array(batch)
 </s> add             batch[return_indices[images[future]].pop()] = future.result()
    batch = np.array(batch) </s> remove     >>> filenames, images = read_image_batch(image_filenames)
 </s> add     >>> images = read_image_batch(image_filenames) </s> remove         The batch of images in `BGR` channel order.
 </s> add         The batch of images in `BGR` channel order returned in the order of :attr:`filenames`
        batch = read_image_batch(filenames)
      def _process_batch(self, filenames, side):
          """ Performs the augmentation and compiles target images and samples. See
          :func:`minibatch_ab` for more details on the output. """
          logger.trace("Process batch: (filenames: '%s', side: '%s')", filenames, side)
        batch = read_image_batch(filenames)
          batch = self._apply_mask(filenames, batch, side)
          processed = dict()
  
          # Initialize processing training size on first image
          if not self._processing.initialized:
keep keep keep keep replace keep keep keep keep keep
 lib.image.read_image_batch - Force deterministic return order 
lib/training_data.py