def HA2(credentails, request):
if credentails.get('<STR_LIT>') == '<STR_LIT>' or credentails.get('<STR_LIT>') is None:<EOL><INDENT>return H(b'<STR_LIT::>'.join([request['<STR_LIT>'].encode('<STR_LIT:utf-8>'),<EOL>request['<STR_LIT>'].encode('<STR_LIT:utf-8>')]))<EOL><DEDENT>elif credentails.get('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>for k in '<STR_LIT>', '<STR_LIT>', '<STR_LIT:body>':<EOL><INDENT>if k not in request:<EOL><INDENT>raise ValueError('<STR_LIT>' % k)<EOL><DEDENT><DEDENT>return H('<STR_LIT>' % (request['<STR_LIT>'],<EOL>request['<STR_LIT>'],<EOL>H(request['<STR_LIT:body>'])))<EOL><DEDENT>raise ValueError<EOL>
Create HA2 md5 hash

    If the qop directive's value is "auth" or is unspecified, then HA2:
        HA2 = md5(A2) = MD5(method:digestURI)
    If the qop directive's value is "auth-int" , then HA2 is
        HA2 = md5(A2) = MD5(method:digestURI:MD5(entityBody))