code: def load_logged_in_user():
      
      user_id = session.get("user_id")
      g.user = User.query.get(user_id) if user_id is not None else None
docs: If a user id is stored in the session, load the user object from
      the database into ``g.user``.