code: def test_get_objects_from_tag(self):
      # create tagged objects
      dashboard = (
          db.session.query(Dashboard)
          .filter(Dashboard.dashboard_title == "World Bank's Data")
          .first()
      )
      dashboard_id = dashboard.id
      tag = db.session.query(Tag).filter_by(name="example_tag_1").one()
      self.insert_tagged_object(
          object_id=dashboard_id,
          object_type=ObjectType.dashboard,
          tag_id=tag.id,
      )
      # get objects
      tagged_objects = TagDAO.get_tagged_objects_for_tags(
          ["example_tag_1", "example_tag_2"]
      )
      assert len(tagged_objects) == 1
  
      # test get objects from tag with type
      tagged_objects = TagDAO.get_tagged_objects_for_tags(
          ["example_tag_1", "example_tag_2"],
          obj_types=["dashboard", "chart"],
      )
      assert len(tagged_objects) == 1
      tagged_objects = TagDAO.get_tagged_objects_for_tags(
          ["example_tag_1", "example_tag_2"], obj_types=["chart"]
      )
      assert len(tagged_objects) == 0
      # test get all objects
      num_charts = (
          db.session.query(Slice)
          .join(
              TaggedObject,
              and_(
                  TaggedObject.object_id == Slice.id,
                  TaggedObject.object_type == ObjectType.chart,
              ),
          )
          .distinct(Slice.id)
          .count()
      )
      num_charts_and_dashboards = (
          db.session.query(Dashboard)
          .join(
              TaggedObject,
              and_(
                  TaggedObject.object_id == Dashboard.id,
                  TaggedObject.object_type == ObjectType.dashboard,
              ),
          )
          .distinct(Dashboard.id)
          .count()
          + num_charts
      )
      # gets all tagged objects of type dashboard and chart
      tagged_objects = TagDAO.get_tagged_objects_for_tags(
          obj_types=["dashboard", "chart"]
      )
      assert len(tagged_objects) == num_charts_and_dashboards
      # test objects are retrieved by type
      tagged_objects = TagDAO.get_tagged_objects_for_tags(
          obj_types=["chart"]
      )
      assert len(tagged_objects) == num_charts
  
imports: from operator import and_
  from unittest.mock import patch
  import pytest
  from superset.daos.exceptions import DAOCreateFailedError, DAOException
  from superset.models.slice import Slice
  from superset.models.sql_lab import SavedQuery
  from superset.daos.tag import TagDAO
  from superset.tags.exceptions import InvalidTagNameError
  from superset.tags.models import ObjectType, Tag, TaggedObject
  from tests.integration_tests.tags.api_tests import TAGS_FIXTURE_COUNT
  import tests.integration_tests.test_app
  from superset import db, security_manager
  from superset.daos.dashboard import DashboardDAO
  from superset.models.dashboard import Dashboard
  from tests.integration_tests.base_tests import SupersetTestCase
  from tests.integration_tests.fixtures.world_bank_dashboard import load_world_bank_dashboard_with_slices, load_world_bank_data
  from tests.integration_tests.fixtures.tags import with_tagging_system_feature
label_desc: Use image node_id 6 for calling the TestTagsDAO obj's underlying member method code with example usage: obj.test_get_objects_from_tag() without return types