class_docstr: A tracker wrapper that caches the state creation of the tracker.
class_docstr_tok: ["A","tracker","wrapper","that","caches","the","state","creation","of","the","tracker","."]
docstr: Modify the state of the tracker according to an ``Event``.
docstr_tok: ["Modify","the","state","of","the","tracker","according","to","an","``","Event","``","."]
code: def update(
      self,
      event: Event,
      domain: Optional[Domain] = None,
  ) -> None:
      """Modify the state of the tracker according to an ``Event``."""
      # if `skip_states` is `True`, this function behaves exactly like the
      # normal update of the `DialogueStateTracker`
      if not self._states_for_hashing and not self.__skip_states:
          # rest of this function assumes we have the previous state
          # cached. let's make sure it is there.
          self._states_for_hashing = self.past_states_for_hashing(
              self.domain
          )
  
      super().update(event)
  
      if not self.__skip_states:
          if isinstance(event, ActionExecuted):
              pass
          elif isinstance(event, ActionReverted):
              self._states_for_hashing.pop()  # removes the state after the action
              self._states_for_hashing.pop()  # removes the state used for the action
          elif isinstance(event, UserUtteranceReverted):
              self.clear_states()
          elif isinstance(event, Restarted):
              self.clear_states()
          else:
              self._states_for_hashing.pop()
  
          self._append_current_state()
  
imports: from collections import defaultdict, namedtuple, deque
  import copy
  import logging
  import random
  from contextlib import contextmanager
  from tqdm import tqdm
  from typing import Optional, List, Text, Set, Dict, Tuple, Deque, DefaultDict, Any, Iterable, Generator
  from rasa.shared.constants import DOCS_URL_STORIES
  from rasa.shared.core.constants import SHOULD_NOT_BE_SET
  from rasa.shared.core.domain import Domain, State
  from rasa.shared.core.events import ActionExecuted, UserUttered, ActionReverted, UserUtteranceReverted, Restarted, Event, SlotSet, ActiveLoop
  from rasa.shared.core.trackers import DialogueStateTracker, FrozenState
  from rasa.shared.core.slots import Slot
  from rasa.shared.core.training_data.structures import StoryGraph, STORY_START, StoryStep, RuleStep, GENERATED_CHECKPOINT_PREFIX
  from rasa.shared.utils.io import is_logging_disabled
  import rasa.shared.utils.io
label_desc: Use image node_id 11 for calling the TrackerWithCachedStates obj's underlying member method code with example usage: obj.update(event, domain) without return types