human
Solve the following python programming problem given the following code:
def keyset_result(iter, params, **kwargs) : 
    import csv 
    import sys 
    def _column_map(keyset, name) : 
        if keyset.get ('column_mappings', None) : 
            mappings = keyset ['column_mappings'] 
            if ((name in mappings) and mappings [name]) : 
                return mappings [name] 
return name 
last_keyset_name = None 
    writer = csv.writer (sys.stdout) 
    for (keys, values) in iter : 
        keyset_name = keys [0] 
        if (last_keyset_name != keys) : 
            keyset = params.keysets [keyset_name] 
            columns = (keyset ['key_parts'] [1 :] + keyset ['value_parts']) 
            mapped = [_column_map (keyset, column) for column in columns] 
            writer.writerow (mapped) 
            last_keyset_name = keyset_name 
data = (keys [1 :] + values) 
        row = [unicode (x).encode ('utf-8') for x in data] 
        writer.writerow (row) 

    
    

    Fix the buggy line: if (last_keyset_name != keys) :
assistant
#Here is Python code to fix the buggy line: if (last_keyset_name != keys) :
.

if (last_keyset_name != keyset_name) :