'Checks a list of hashes for presence in the store.
Only unique sha1 hashes are checked, if there is duplication in the hashes
input it is the caller\'s responsibility to maintain any necessary mappings.
Args:
hashes: A list of Hash objects to check.
unused_external: Ignored.
Yields:
Tuples of (RDFURN, hash object) that exist in the store.'

def CheckHashes(self, hashes, unused_external=True):

    hash_map = {}
    for hsh in hashes:
        if hsh.HasField('sha1'):
            hash_urn = self.PATH.Add(str(hsh.sha1))
            logging.debug('Checking    URN    %s', str(hash_urn))
            hash_map[hash_urn] = hsh
    for metadata in aff4.FACTORY.Stat(list(hash_map), token=self.token):
        (yield (metadata['urn'], hash_map[metadata['urn']]))
