      executor = futures.ThreadPoolExecutor()
      with executor:
          images = {executor.submit(read_image, filename, raise_error=True): filename
                    for filename in filenames}
          batch = []
          filenames = []
          for future in futures.as_completed(images):
              batch.append(future.result())
              filenames.append(images[future])
          batch = np.array(batch)
      logger.trace("Returning images: (filenames: %s, batch shape: %s)", filenames, batch.shape)
 
</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     return filenames, batch
 </s> add     return batch </s> remove         filenames, batch = read_image_batch(filenames)
 </s> add         batch = read_image_batch(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 = [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)}
      executor = futures.ThreadPoolExecutor()
      with executor:
          images = {executor.submit(read_image, filename, raise_error=True): filename
                    for filename in filenames}
        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)}
        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)}
          for future in futures.as_completed(images):
              batch.append(future.result())
              filenames.append(images[future])
          batch = np.array(batch)
      logger.trace("Returning images: (filenames: %s, batch shape: %s)", filenames, batch.shape)
keep keep keep keep replace replace keep keep keep keep keep
 lib.image.read_image_batch - Force deterministic return order 
lib/image.py