class_docstr: Defines functionality for the available slot mappings.
class_docstr_tok: ["Defines","functionality","for","the","available","slot","mappings","."]
docstr: Checks the mapping for validity.
  
  Args:
      slot_name: The name of the slot to be validated.
      mapping_type: The type of the slot mapping.
      mapping: Slot mapping.
      domain: The domain to check against.
  
  Returns:
      True, if intent and entity specified in a mapping exist in domain.
docstr_tok: ["Checks","the","mapping","for","validity",".","Args",":","slot_name",":","The","name","of","the","slot","to","be","validated",".","mapping_type",":","The","type","of","the","slot","mapping",".","mapping",":","Slot","mapping",".","domain",":","The","domain","to","check","against",".","Returns",":","True",",","if","intent","and","entity","specified","in","a","mapping","exist","in","domain","."]
code: def check_mapping_validity(
      slot_name: Text,
      mapping_type: SlotMappingType,
      mapping: Dict[Text, Any],
      domain: "Domain",
  ) -> bool:
      """Checks the mapping for validity.
  
      Args:
          slot_name: The name of the slot to be validated.
          mapping_type: The type of the slot mapping.
          mapping: Slot mapping.
          domain: The domain to check against.
  
      Returns:
          True, if intent and entity specified in a mapping exist in domain.
      """
      if (
          mapping_type == SlotMappingType.FROM_ENTITY
          and mapping.get(ENTITY_ATTRIBUTE_TYPE) not in domain.entities
      ):
          rasa.shared.utils.io.raise_warning(
              f"Slot '{slot_name}' uses a 'from_entity' mapping "
              f"for a non-existent entity '{mapping.get(ENTITY_ATTRIBUTE_TYPE)}'. "
              f"Skipping slot extraction because of invalid mapping."
          )
          return False
  
      if (
          mapping_type == SlotMappingType.FROM_INTENT
          and mapping.get(INTENT) is not None
      ):
          intent_list = SlotMapping.to_list(mapping.get(INTENT))
          for intent in intent_list:
              if intent and intent not in domain.intents:
                  rasa.shared.utils.io.raise_warning(
                      f"Slot '{slot_name}' uses a 'from_intent' mapping for "
                      f"a non-existent intent '{mapping.get('intent')}'. "
                      f"Skipping slot extraction because of invalid mapping."
                  )
                  return False
  
      return True
  
file_path: rasa/rasa/shared/core/slot_mappings.py
imports: from typing import Text, Dict, Any, List, Optional, TYPE_CHECKING
  from rasa.shared.constants import DOCS_URL_SLOTS, IGNORED_INTENTS
  import rasa.shared.utils.io
  from rasa.shared.nlu.constants import ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_ROLE, ENTITY_ATTRIBUTE_GROUP, INTENT, NOT_INTENT, INTENT_NAME_KEY
  from rasa.shared.core.constants import SLOT_MAPPINGS, MAPPING_TYPE, SlotMappingType, MAPPING_CONDITIONS
label_desc: Use image node_id 6 for calling the SlotMapping obj's underlying member method code with example usage: obj.check_mapping_validity(slot_name, mapping_type, mapping, domain) and returns: True, False, False