docstr: Returns the IDs of tags that the current user has favorited.
  
  This function takes in a list of Tag objects, extracts their IDs, and checks
  which of these IDs exist in the user_favorite_tag_table for the current user.
  The function returns a list of these favorited tag IDs.
  
  Args:
      tags (list[Tag]): A list of Tag objects.
  
  Returns:
      list[Any]: A list of IDs corresponding to the tags that are favorited by
      the current user.
  
  Example:
      favorited_ids([tag1, tag2, tag3])
      Output: [tag_id1, tag_id3]   # if the current user has favorited tag1 and tag3
docstr_tok: ["Returns","the","IDs","of","tags","that","the","current","user","has","favorited",".","This","function","takes","in","a","list","of","Tag","objects",",","extracts","their","IDs",",","and","checks","which","of","these","IDs","exist","in","the","user_favorite_tag_table","for","the","current","user",".","The","function","returns","a","list","of","these","favorited","tag","IDs",".","Args",":","tags","(","list","[","Tag","]",")",":","A","list","of","Tag","objects",".","Returns",":","list","[","Any","]",":","A","list","of","IDs","corresponding","to","the","tags","that","are","favorited","by","the","current","user",".","Example",":","favorited_ids","(","[","tag1",",","tag2",",","tag3","]",")","Output",":","[","tag_id1",",","tag_id3","]","#","if","the","current","user","has","favorited","tag1","and","tag3"]
code: def favorited_ids(tags: list[Tag]) -> list[int]:
      """
      Returns the IDs of tags that the current user has favorited.
  
      This function takes in a list of Tag objects, extracts their IDs, and checks
      which of these IDs exist in the user_favorite_tag_table for the current user.
      The function returns a list of these favorited tag IDs.
  
      Args:
          tags (list[Tag]): A list of Tag objects.
  
      Returns:
          list[Any]: A list of IDs corresponding to the tags that are favorited by
          the current user.
  
      Example:
          favorited_ids([tag1, tag2, tag3])
          Output: [tag_id1, tag_id3]   # if the current user has favorited tag1 and tag3
      """
      ids = [tag.id for tag in tags]
      return [
          star.tag_id
          for star in db.session.query(user_favorite_tag_table.c.tag_id)
          .filter(
              user_favorite_tag_table.c.tag_id.in_(ids),
              user_favorite_tag_table.c.user_id == get_user_id(),
          )
          .all()
      ]
  
imports: import logging
  from operator import and_
  from typing import Any, Optional
  from flask import g
  from sqlalchemy.exc import SQLAlchemyError
  from superset.commands.tag.exceptions import TagNotFoundError
  from superset.commands.tag.utils import to_object_type
  from superset.daos.base import BaseDAO
  from superset.daos.exceptions import DAODeleteFailedError
  from superset.exceptions import MissingUserContextException
  from superset.extensions import db
  from superset.models.dashboard import Dashboard
  from superset.models.slice import Slice
  from superset.models.sql_lab import SavedQuery
  from superset.tags.models import get_tag, ObjectType, Tag, TaggedObject, TagType, user_favorite_tag_table
  from superset.utils.core import get_user_id
label_desc: Use image node_id 11 for calling the TagDAO obj's underlying member method code with example usage: obj.favorited_ids(tags) and returns: unknown