'Convert FileFinder results.
Args:
metadata_value_pairs: array of ExportedMetadata and rdfvalue tuples.
token: ACLToken
Yields:
ExportedFile, ExportedRegistryKey, or ExportedMatch
FileFinderResult objects have 3 types of results that need to be handled
separately. Files, registry keys, and grep matches. The file results are
similar to statentry exports, and share some code, but different because we
already have the hash available without having to go back to the database to
retrieve it from the aff4 object.'

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

    (registry_pairs, file_pairs, match_pairs) = self._SeparateTypes(metadata_value_pairs)
    fds_dict = self._OpenFilesForRead([(metadata, val.stat_entry) for (metadata, val) in file_pairs], token=token)
    for (metadata, ff_result) in file_pairs:
        result = self._CreateExportedFile(metadata, ff_result.stat_entry)
        self.ParseFileHash(ff_result.hash_entry, result)
        if self.options.export_files_contents:
            urn = ff_result.stat_entry.AFF4Path(metadata.client_urn)
            try:
                aff4_object = fds_dict[urn]
                self._ExportFileContent(aff4_object, result)
            except KeyError:
                logging.warn("Couldn't    open    %s    for    export", urn)
        (yield result)
    for result in ConvertValuesWithMetadata(registry_pairs, token=token, options=self.options):
        (yield result)
    for result in ConvertValuesWithMetadata(match_pairs, token=token, options=self.options):
        (yield result)
