def get_ha1_dict_plain(user_password_dict):
 def get_ha1(realm, username):
  password = user_password_dict.get(username)
  if password:
   return md5_hex(('%s:%s:%s' % (username, realm, password)))
  return None
 return get_ha1

def get_ha1_dict_plain ( user_password_dict ) : def get_ha1 ( realm , username ) : password = user_password_dict . get ( username ) if password : return md5_hex ( ( '%s:%s:%s' % ( username , realm , password ) ) ) return None return get_ha1
returns a get_ha1 function which obtains a plaintext password from a dictionary of the form: {username : password} .