'Store a group of entities in the result database.
Args:
keys: A list of entity keys.
entities: A list of entities.
Returns:
The number of new entities stored in the result database.'

def StoreEntities(self, keys, entities):

    self._OpenSecondaryConnection()
    t = time.time()
    count = 0
    for (entity_id, entity) in zip(keys, entities):
        if self._StoreEntity(entity_id, entity):
            count += 1
    logger.debug('%s    insert:    delta=%.3f', self.db_filename, (time.time() - t))
    logger.debug('Entities    transferred    total:    %s', self.count)
    self._MaybeCommit()
    return count
