parameters: (email, password)
return_statement: return user
docstring: Returns the authenticated user or None.
docstring_summary: Returns the authenticated user or None.
docstring_tokens: Returns the authenticated user or None .
function: def auth_user(email, password):
          """Returns the authenticated user or None."""
          user = User.objects(email=email)
  
          if not user:
              return None
  
          # TODO(sandy): Since we added a unique index on email, this shouldn't
          # happen anymore. But keep this around for a bit, in case something
          # messes up [Apr 8, 2014]
          if user.count() > 1:
              logging.error('Multiple email addressed matched: %s' % email)
              return None
  
          user = user.first()
  
          # TODO(sandy): Provide more helpful errors for users signed up with fb
          if (not user.password or
              not bcrypt.check_password_hash(user.password, password)):
              return None
  
          return user
function_tokens: def auth_user ( email , password ) : user = User . objects ( email = email ) if not user : return None # TODO(sandy): Since we added a unique index on email, this shouldn't # happen anymore. But keep this around for a bit, in case something # messes up [Apr 8, 2014] if user . count ( ) > 1 : logging . error ( 'Multiple email addressed matched: %s' % email ) return None user = user . first ( ) # TODO(sandy): Provide more helpful errors for users signed up with fb if ( not user . password or not bcrypt . check_password_hash ( user . password , password ) ) : return None return user