An SQLAlchemy User getting function. Get a user by public key.

    :param str key: the public key the user belongs to

def get_user_by_key(app, key):
    """
    An SQLAlchemy User getting function. Get a user by public key.

    :param str key: the public key the user belongs to
    """
    user = ses.query(um.User).join(um.UserKey).filter(um.UserKey.key==key).first()
    return user