def METHOD_NAME(session: Session) -> list[Account]:
    """Return all accounts which neither belong to a user nor are user assets"""
    # TODO use session.execute(select(…))
    return (
        Account.q.outerjoin(User)
        .filter(and_(User.account_id.is_(None), Account.type != "USER_ASSET"))
        .all()
    )