human
Solve the following python programming problem given the following code:
def bulk_add_messages(self, data) : 
    check_query = ('select count(*) from message where account = ? and folder = ? and uid in (%s)' % ','.join ((str (row [0]) for row in data))) 
    res = self._execute (check_query, (self._account.name, self.name)) 
    assert (single_result (check_query) == 0), 'Some messages already exist' 
    def sql_rows() : 
        account_name = self._account.name 
        folder_name = self.name 
        for (uid, flags, headers) in data : 
            (yield (account_name, folder_name, uid, flatten (flags), headers.decode ('latin-1'))) 
insert_query = 'insert into message(account, folder, uid, flags, headers) values (?, ?, ?, ?, ?)' 
    self._executemany (insert_query, sql_rows ()) 

    
    

    Fix the buggy line: assert (single_result (check_query) == 0), 'Some messages already exist'
assistant
#Here is Python program to fix the buggy line: assert (single_result (check_query) == 0), 'Some messages already exist'
.

assert (single_result (res) == 0), 'Some messages already exist'