'Check if blobs for the given digests already exist.'

def BlobsExist(self, digests, token=None):

    res = {digest: False for digest in digests}
    urns = {self._BlobUrn(digest): digest for digest in digests}
    existing = aff4.FACTORY.MultiOpen(urns, aff4_type=aff4.AFF4MemoryStreamBase, mode='r', token=token)
    for blob in existing:
        res[urns[blob.urn]] = True
    return res
