code: def test_slot_mapping_intent_is_desired(domain: Domain):
      domain = Domain.from_file("examples/formbot/domain.yml")
      tracker = DialogueStateTracker(
          "sender_id_test", slots=domain.slots
      )
      event1 = UserUttered(
          text="I'd like to book a restaurant for 2 people.",
          intent={
              "name": "request_restaurant",
              "confidence": 0.9604260921478271,
          },
          entities=[{"entity": "number", "value": 2}],
      )
      tracker.update(event1, domain)
      mappings_for_num_people = (
          domain.as_dict()
          .get("slots")
          .get("num_people")
          .get("mappings")
      )
      assert SlotMapping.intent_is_desired(
          mappings_for_num_people[0], tracker, domain
      )
  
      event2 = UserUttered(
          text="Yes, 2 please",
          intent={"name": "affirm", "confidence": 0.9604260921478271},
          entities=[{"entity": "number", "value": 2}],
      )
      tracker.update(event2, domain)
      assert (
          SlotMapping.intent_is_desired(
              mappings_for_num_people[0], tracker, domain
          )
          is False
      )
  
      event3 = UserUttered(
          text="Yes, please",
          intent={"name": "affirm", "confidence": 0.9604260921478271},
          entities=[],
      )
      tracker.update(event3, domain)
      mappings_for_preferences = (
          domain.as_dict()
          .get("slots")
          .get("preferences")
          .get("mappings")
      )
      assert (
          SlotMapping.intent_is_desired(
              mappings_for_preferences[0], tracker, domain
          )
          is False
      )
  
file_path: rasa/tests/shared/core/test_slot_mappings.py
imports: from typing import Text
  import pytest
  from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
  from rasa.shared.core.constants import SlotMappingType
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.events import UserUttered, ActiveLoop
  from rasa.shared.core.slot_mappings import SlotMapping
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.shared.utils.validation import YamlValidationException
label_desc: Use image node_id 2 for calling a global function with example usage: test_slot_mapping_intent_is_desired(domain) without return types