'Converts a batch of StatEntry value to ExportedFile values at once.
Args:
metadata_value_pairs: a list or a generator of tuples (metadata, value),
where metadata is ExportedMetadata to be used for
conversion and value is a StatEntry to be converted.
token: Security token:
Yields:
Resulting ExportedFile values. Empty list is a valid result and means that
conversion wasn\'t possible.'

def BatchConvert(self, metadata_value_pairs, token=None):

    filtered_pairs = self._RemoveRegistryKeys(metadata_value_pairs)
    fds_dict = self._OpenFilesForRead(filtered_pairs, token=token)
    for (metadata, stat_entry) in filtered_pairs:
        result = self._CreateExportedFile(metadata, stat_entry)
        if self.open_file_for_read:
            try:
                aff4_object = fds_dict[stat_entry.AFF4Path(metadata.client_urn)]
                self._ExportHash(aff4_object, result)
                self._ExportFileContent(aff4_object, result)
            except KeyError:
                pass
        (yield result)
