def METHOD_NAME(id: str = None, username: str = None) -> Optional["User"]:
    """Find a user using one of the provided arguments.
    The first argument which is not None is used in the query.  The order
    in which the arguments are considered follows the method signature.
    Returns:
        A User object if a user is found, None otherwise.
    """
    dbsq = Database.db_session.METHOD_NAME(User)
    if id:
        user = dbsq.filter_by(id=id).first()
    elif username:
        user = dbsq.filter_by(username=username).first()
    else:
        user = None
    return user