def checkpassword_dict(user_password_dict):
 def checkpassword(realm, user, password):
  p = user_password_dict.get(user)
  return ((p and (p == password)) or False)
 return checkpassword

def checkpassword_dict ( user_password_dict ) : def checkpassword ( realm , user , password ) : p = user_password_dict . get ( user ) return ( ( p and ( p == password ) ) or False ) return checkpassword
returns a checkpassword function which checks credentials against a dictionary of the form: {username : password} .