class_docstr: Implements owners validation,pre load and post_load
  (to populate the owners field) on Marshmallow schemas
class_docstr_tok: ["Implements","owners","validation",",","pre","load","and","post_load","(","to","populate","the","owners","field",")","on","Marshmallow","schemas"]
code: def set_owners(instance: Model, owners: list[int]) -> None:
      owner_objs = []
      user_id = get_user_id()
      if user_id and user_id not in owners:
          owners.append(user_id)
      for owner_id in owners:
          user = current_app.appbuilder.get_session.query(
              current_app.appbuilder.sm.user_model
          ).get(owner_id)
          owner_objs.append(user)
      instance.owners = owner_objs
  
file_path: superset/superset/views/base_schemas.py
imports: from collections.abc import Iterable, Mapping, Sequence
  from typing import Any, Optional, Union
  from flask import current_app, g
  from flask_appbuilder import Model
  from marshmallow import post_load, pre_load, Schema, ValidationError
  from sqlalchemy.exc import NoResultFound
  from superset.utils.core import get_user_id
label_desc: Use image node_id 3 for calling the BaseOwnedSchema obj's underlying member method code with example usage: obj.set_owners(instance, owners) without return types