def METHOD_NAME(keys, table, conn):
    '''fetch all of the records for keys and comapre their values'''
    if not keys:
        return
    # - check that all records look correct
    deadline = time.time() + errorToleranceSecs
    lastError = None
    while time.time() < deadline:
        try:
            startKey = keys[0]
            endKey = keys[-1]
            keyCount = len(keys)
            for row in table.get_all(*keys).run(conn):
                assert row['id'] in keys, 'Unexpected id in fetched result: %r' % row
                assert 'val' in row and row['id'] == row['id'] == row['val'], 'Val did not match id: %r' % row
                keys.remove(row['id'])
            assert keys == [], 'Database did not have all expected values, missing at least: %r' % keys
            utils.print_with_time('\tVerified keys %r to %r... %d records' % (startKey, endKey, keyCount))
            break
        except conn._r.ReqlError as e:
            if opts["tolerate_errors"]:
                lastError = e
                time.sleep(.1)
            else:
                raise
    else:
        if lastError:
            raise lastError