code: def _build_conflicts_from_states(
      trackers: List[TrackerWithCachedStates],
      domain: Domain,
      max_history: Optional[int],
      conflicting_state_action_mapping: Dict[int, List[int]],
      tokenizer: Optional[Tokenizer] = None,
  ) -> List["StoryConflict"]:
      """Builds a list of `StoryConflict` objects for each given conflict.
  
      Args:
          trackers: Trackers that contain the states.
          domain: The domain object.
          max_history: Number of turns to take into account for the state descriptions.
          conflicting_state_action_mapping: A dictionary mapping state-hashes to a list
              of actions that follow from each state.
          tokenizer: A tokenizer to tokenize the user messages.
  
      Returns:
          A list of `StoryConflict` objects that describe inconsistencies in the story
          structure. These objects also contain the history that leads up to the conflict.
      """
      # Iterate once more over all states and note the (unhashed) state,
      # for which a conflict occurs
      conflicts = {}
      for element in _sliced_states_iterator(
          trackers, domain, max_history, tokenizer
      ):
          hashed_state = element.sliced_states_hash
  
          if hashed_state in conflicting_state_action_mapping:
              if hashed_state not in conflicts:
                  conflicts[hashed_state] = StoryConflict(
                      element.sliced_states
                  )
  
              conflicts[hashed_state].add_conflicting_action(
                  action=str(element.event),
                  story_name=element.tracker.sender_id,
              )
  
      # Return list of conflicts that arise from unpredictable actions
      # (actions that start the conversation)
      return [
          conflict
          for (hashed_state, conflict) in conflicts.items()
          if conflict.conflict_has_prior_events
      ]
  
imports: from collections import defaultdict
  import logging
  import json
  from typing import DefaultDict, Dict, Generator, List, NamedTuple, Optional, Text, Tuple
  from rasa.core.featurizers.tracker_featurizers import MaxHistoryTrackerFeaturizer
  from rasa.shared.core.constants import ACTION_LISTEN_NAME, PREVIOUS_ACTION, ACTION_UNLIKELY_INTENT_NAME, USER
  from rasa.shared.core.domain import Domain, State
  from rasa.shared.core.events import ActionExecuted, Event
  from rasa.shared.core.generator import TrackerWithCachedStates
  from rasa.nlu.tokenizers.tokenizer import Tokenizer
  from rasa.shared.nlu.constants import TEXT
  from rasa.shared.nlu.training_data.message import Message
label_desc: Use image node_id 4 for calling a global function with example usage: _build_conflicts_from_states(trackers, domain, max_history, conflicting_state_action_mapping, tokenizer) and returns: unknown