class_docstr: Action which implements and executes the form logic.
class_docstr_tok: ["Action","which","implements","and","executes","the","form","logic","."]
code: def _get_events_since_last_user_uttered(
      tracker: "DialogueStateTracker",
  ) -> List[SlotSet]:
      # TODO: Better way to get this latest_message index is through an instance
      # variable, eg. tracker.latest_message_index
      index_from_end = next(
          (
              i
              for i, event in enumerate(reversed(tracker.events))
              if event == Restarted() or event == tracker.latest_message
          ),
          len(tracker.events) - 1,
      )
      index = len(tracker.events) - index_from_end - 1
      events_since_last_user_uttered = [
          event
          for event in itertools.islice(tracker.events, index, None)
          if isinstance(event, SlotSet)
      ]
  
      return events_since_last_user_uttered
  
imports: import copy
  from typing import Text, List, Optional, Union, Any, Dict, Set
  import itertools
  import logging
  import structlog
  import json
  from rasa.core.actions import action
  from rasa.core.actions.loops import LoopAction
  from rasa.core.channels import OutputChannel
  from rasa.shared.core.domain import Domain, KEY_SLOTS
  from rasa.shared.core.constants import SlotMappingType, SLOT_MAPPINGS, MAPPING_TYPE
  from rasa.core.actions.action import ActionExecutionRejection, RemoteAction
  from rasa.shared.core.constants import ACTION_EXTRACT_SLOTS, ACTION_LISTEN_NAME, REQUESTED_SLOT
  from rasa.shared.constants import UTTER_PREFIX
  from rasa.shared.core.events import Event, SlotSet, ActionExecuted, ActiveLoop, ActionExecutionRejected, Restarted
  from rasa.core.nlg import NaturalLanguageGenerator
  from rasa.shared.core.slot_mappings import SlotMapping
  from rasa.shared.core.slots import ListSlot
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.utils.endpoints import EndpointConfig
label_desc: Use image node_id 12 for calling the FormAction obj's underlying member method code with example usage: obj._get_events_since_last_user_uttered(tracker) and returns: events_since_last_user_uttered