class_docstr: A class used to verify usage of intents and utterances.
class_docstr_tok: ["A","class","used","to","verify","usage","of","intents","and","utterances","."]
docstr: Verifies usage of utterances in stories.
  
  Checks whether utterances used in the stories are valid,
  and whether all valid utterances are used in stories.
docstr_tok: ["Verifies","usage","of","utterances","in","stories",".","Checks","whether","utterances","used","in","the","stories","are","valid",",","and","whether","all","valid","utterances","are","used","in","stories","."]
code: def verify_utterances_in_stories(
      self, ignore_warnings: bool = True
  ) -> bool:
      """Verifies usage of utterances in stories.
  
      Checks whether utterances used in the stories are valid,
      and whether all valid utterances are used in stories.
      """
      everything_is_alright = True
  
      utterance_actions = self._gather_utterance_actions()
      stories_utterances = set()
  
      for story in self.story_graph.story_steps:
          for event in story.events:
              if not isinstance(event, ActionExecuted):
                  continue
  
              if not event.action_name:
                  continue
  
              if not event.action_name.startswith(UTTER_PREFIX):
                  # we are only interested in utter actions
                  continue
  
              if event.action_name in stories_utterances:
                  # we already processed this one before, we only want to warn once
                  continue
  
              if event.action_name not in utterance_actions:
                  rasa.shared.utils.io.raise_warning(
                      f"The action '{event.action_name}' is used in the stories, "
                      f"but is not a valid utterance action. Please make sure "
                      f"the action is listed in your domain and there is a "
                      f"template defined with its name.",
                      docs=DOCS_URL_ACTIONS + "#utterance-actions",
                  )
                  everything_is_alright = ignore_warnings
              stories_utterances.add(event.action_name)
  
      for utterance in utterance_actions:
          if utterance not in stories_utterances:
              rasa.shared.utils.io.raise_warning(
                  f"The utterance '{utterance}' is not used in any story or rule."
              )
              everything_is_alright = (
                  ignore_warnings or everything_is_alright
              )
  
      return everything_is_alright
  
imports: import logging
  from collections import defaultdict
  from typing import Set, Text, Optional, Dict, Any, List
  import rasa.core.training.story_conflict
  import rasa.shared.nlu.constants
  from rasa.shared.constants import ASSISTANT_ID_DEFAULT_VALUE, ASSISTANT_ID_KEY, CONFIG_MANDATORY_KEYS, DOCS_URL_DOMAINS, DOCS_URL_FORMS, UTTER_PREFIX, DOCS_URL_ACTIONS, REQUIRED_SLOTS_KEY
  from rasa.shared.core import constants
  from rasa.shared.core.constants import MAPPING_CONDITIONS, ACTIVE_LOOP
  from rasa.shared.core.events import ActionExecuted, ActiveLoop
  from rasa.shared.core.events import UserUttered
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.generator import TrainingDataGenerator
  from rasa.shared.core.constants import SlotMappingType, MAPPING_TYPE
  from rasa.shared.core.training_data.structures import StoryGraph
  from rasa.shared.importers.importer import TrainingDataImporter
  from rasa.shared.nlu.training_data.training_data import TrainingData
  import rasa.shared.utils.io
label_desc: Use image node_id 8 for calling the Validator obj's underlying member method code with example usage: obj.verify_utterances_in_stories(ignore_warnings) and returns: everything_is_alright