code: def create_slice_to_db(
      name: Optional[str] = None,
      datasource_id: Optional[int] = None,
      owners: Optional[list[User]] = None,
  ) -> Slice:
      slice_ = create_slice(datasource_id, name=name, owners=owners)
      insert_model(slice_)
      inserted_slices_ids.append(slice_.id)
      return slice_
  
imports: import logging
  from typing import Optional
  from flask_appbuilder import Model
  from flask_appbuilder.security.sqla.models import User
  from superset import db
  from superset.connectors.sqla.models import SqlaTable, sqlatable_user
  from superset.models.core import Database
  from superset.models.dashboard import Dashboard, dashboard_slices, dashboard_user, DashboardRoles
  from superset.models.slice import Slice, slice_user
  from tests.integration_tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
label_desc: Use image node_id 4 for calling a global function with example usage: create_slice_to_db(name, datasource_id, owners) and returns: slice_