human
Solve the following python programming problem given the following code:
def _gen_response(self, charset, realm, nonce) : 
    '
        Generate response-value.

        Creates a response to a challenge according to section 2.1.2.1 of
        RFC 2831 using the L{charset}, L{realm} and L{nonce} directives
        from the challenge.
        ' 
    def H(s) : 
        return md5 (s).digest () 
def HEX(n) : 
        return binascii.b2a_hex (n) 
def KD(k, s) : 
        return H (('%s:%s' % (k, s))) 
try : 
        username = self.username.encode (charset) 
        password = self.password.encode (charset) 
except UnicodeError : 
        raise 
nc = ('%08x' % 1) 
    cnonce = self._gen_nonce () 
    qop = 'auth' 
    a1 = ('%s:%s:%s' % (H (('%s:%s:%s' % (username, realm, password))), nonce, cnonce)) 
    a2 = ('AUTHENTICATE:%s' % self.digest_uri) 
    response = HEX (KD (HEX (H (a1)), ('%s:%s:%s:%s:%s' % (nonce, nc, cnonce, 'auth', HEX (H (a2)))))) 
    directives = { 
        'username' : username, 
        'realm' : realm, 
        'nonce' : nonce, 
        'cnonce' : cnonce, 
        'nc' : nc, 
        'qop' : qop, 
        'digest-uri' : self.digest_uri, 
        'response' : response, 
        'charset' : charset, 
} 
    return self._unparse (nc) 

    
    

    Fix the buggy line: return self._unparse (nc)
assistant
#Here is Python program to fix the buggy line: return self.

return self._unparse (directives)