code: def test_remove_favorite(session_with_data: Session) -> None:
      from superset.daos.chart import ChartDAO
  
      chart = ChartDAO.find_by_id(
          1, session=session_with_data, skip_base_filter=True
      )
      if not chart:
          return
      assert len(ChartDAO.favorited_ids([chart])) == 0
  
      ChartDAO.add_favorite(chart)
      assert len(ChartDAO.favorited_ids([chart])) == 1
  
      ChartDAO.remove_favorite(chart)
      assert len(ChartDAO.favorited_ids([chart])) == 0
  
      ChartDAO.remove_favorite(chart)
      assert len(ChartDAO.favorited_ids([chart])) == 0
  
file_path: superset/tests/unit_tests/charts/dao/dao_tests.py
imports: from collections.abc import Iterator
  import pytest
  from sqlalchemy.orm.session import Session
  from superset.utils.core import DatasourceType
label_desc: Use image node_id 5 for calling a global function with example usage: test_remove_favorite(session_with_data) without return types