'Open files all at once if necessary.'

def _OpenFilesForRead(self, metadata_value_pairs, token):

    if self.open_file_for_read:
        aff4_paths = [result.AFF4Path(metadata.client_urn) for (metadata, result) in metadata_value_pairs]
        fds = aff4.FACTORY.MultiOpen(aff4_paths, mode='r', token=token)
        fds_dict = dict([(fd.urn, fd) for fd in fds])
        return fds_dict
