              batch.append(future.result())
              filenames.append(images[future])
          batch = np.array(batch)
      logger.trace("Returning images: (filenames: %s, batch shape: %s)", filenames, batch.shape)
      return filenames, batch
  
  
  def read_image_hash(filename):
      """ Return the `sha1` hash of an image saved on disk.
  
 
</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         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         filenames, batch = read_image_batch(filenames)
 </s> add         batch = read_image_batch(filenames) </s> remove     Leverages multi-threading to load multiple images from disk at the same time
    leading to vastly reduced image read times.

    Notes
    -----
    Images are loaded concurrently, so the order of the returned batch will likely not be the same
    as the order of the input filenames. Filenames are returned with the batch in the correct order
    corresponding to the returned batch.
 </s> add     Leverages multi-threading to load multiple images from disk at the same time leading to vastly
    reduced image read times. </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`
    return batch
              batch.append(future.result())
              filenames.append(images[future])
          batch = np.array(batch)
      logger.trace("Returning images: (filenames: %s, batch shape: %s)", filenames, batch.shape)
    return batch
  
  
  def read_image_hash(filename):
      """ Return the `sha1` hash of an image saved on disk.
  
keep keep keep keep replace keep keep keep keep keep
 lib.image.read_image_batch - Force deterministic return order 
lib/image.py