code: def get_user_by_key(app, key):
      
      user = ses.query(um.User).join(um.UserKey).filter(um.UserKey.key==key).first()
      return user
docs: An SQLAlchemy User getting function. Get a user by public key.
  
      :param str key: the public key the user belongs to