code: def add_owners(metadata: MetaData) -> None:
      """
      Tag every object according to its owner:
  
        INSERT INTO tagged_object (tag_id, object_id, object_type)
        SELECT
          tag.id AS tag_id,
          slices.id AS object_id,
          'chart' AS object_type
        FROM slices
        JOIN tag
        ON tag.name = CONCAT('owner:', slices.created_by_fk)
        LEFT OUTER JOIN tagged_object
          ON tagged_object.tag_id = tag.id
          AND tagged_object.object_id = slices.id
          AND tagged_object.object_type = 'chart'
        WHERE tagged_object.tag_id IS NULL;
  
        SELECT
          tag.id AS tag_id,
          dashboards.id AS object_id,
          'dashboard' AS object_type
        FROM dashboards
        JOIN tag
        ON tag.name = CONCAT('owner:', dashboards.created_by_fk)
        LEFT OUTER JOIN tagged_object
          ON tagged_object.tag_id = tag.id
          AND tagged_object.object_id = dashboards.id
          AND tagged_object.object_type = 'dashboard'
        WHERE tagged_object.tag_id IS NULL;
  
        SELECT
          tag.id AS tag_id,
          saved_query.id AS object_id,
          'query' AS object_type
        FROM saved_query
        JOIN tag
        ON tag.name = CONCAT('owner:', saved_query.created_by_fk)
        LEFT OUTER JOIN tagged_object
          ON tagged_object.tag_id = tag.id
          AND tagged_object.object_id = saved_query.id
          AND tagged_object.object_type = 'query'
        WHERE tagged_object.tag_id IS NULL;
  
        SELECT
          tag.id AS tag_id,
          tables.id AS object_id,
          'dataset' AS object_type
        FROM tables
        JOIN tag
        ON tag.name = CONCAT('owner:', tables.created_by_fk)
        LEFT OUTER JOIN tagged_object
          ON tagged_object.tag_id = tag.id
          AND tagged_object.object_id = tables.id
          AND tagged_object.object_type = 'dataset'
        WHERE tagged_object.tag_id IS NULL;
  
      """
  
      tag = metadata.tables["tag"]
      tagged_object = metadata.tables["tagged_object"]
      users = metadata.tables["ab_user"]
      columns = ["tag_id", "object_id", "object_type"]
  
      # create a custom tag for each user
      ids = select([users.c.id])
      insert = tag.insert()
      for (id_,) in db.session.execute(ids):
          with contextlib.suppress(IntegrityError):  # already exists
              db.session.execute(
                  insert, name=f"owner:{id_}", type=TagType.owner
              )
      add_owners_to_charts(metadata, tag, tagged_object, columns)
      add_owners_to_dashboards(metadata, tag, tagged_object, columns)
      add_owners_to_saved_queries(metadata, tag, tagged_object, columns)
      add_owners_to_datasets(metadata, tag, tagged_object, columns)
  
file_path: superset/superset/common/tags.py
imports: import contextlib
  from typing import Any
  from sqlalchemy import MetaData
  from sqlalchemy.exc import IntegrityError
  from sqlalchemy.sql import and_, func, join, literal, select
  from superset.extensions import db
  from superset.tags.models import ObjectType, TagType
label_desc: Use image node_id 10 for calling a global function with example usage: add_owners(metadata) without return types