class_docstr: A policy that follows exact examples of `max_history` turns in training stories.
  
  Since `slots` that are set some time in the past are
  preserved in all future feature vectors until they are set
  to None, this policy implicitly remembers and most importantly
  recalls examples in the context of the current dialogue
  longer than `max_history`.
  
  This policy is not supposed to be the only policy in an ensemble,
  it is optimized for precision and not recall.
  It should get a 100% precision because it emits probabilities of 1.1
  along it's predictions, which makes every mistake fatal as
  no other policy can overrule it.
  
  If it is needed to recall turns from training dialogues where
  some slots might not be set during prediction time, and there are
  training stories for this, use AugmentedMemoizationPolicy.
class_docstr_tok: ["A","policy","that","follows","exact","examples","of","`","max_history","`","turns","in","training","stories",".","Since","`","slots","`","that","are","set","some","time","in","the","past","are","preserved","in","all","future","feature","vectors","until","they","are","set","to","None",",","this","policy","implicitly","remembers","and","most","importantly","recalls","examples","in","the","context","of","the","current","dialogue","longer","than","`","max_history","`",".","This","policy","is","not","supposed","to","be","the","only","policy","in","an","ensemble",",","it","is","optimized","for","precision","and","not","recall",".","It","should","get","a","100","%","precision","because","it","emits","probabilities","of","1.1","along","it","'s","predictions",",","which","makes","every","mistake","fatal","as","no","other","policy","can","overrule","it",".","If","it","is","needed","to","recall","turns","from","training","dialogues","where","some","slots","might","not","be","set","during","prediction","time",",","and","there","are","training","stories","for","this",",","use","AugmentedMemoizationPolicy","."]
code: def train(
      self,
      training_trackers: List[TrackerWithCachedStates],
      domain: Domain,
      **kwargs: Any,
  ) -> Resource:
      # only considers original trackers (no augmented ones)
      training_trackers = [
          t
          for t in training_trackers
          if not hasattr(t, "is_augmented") or not t.is_augmented
      ]
      training_trackers = SupportedData.trackers_for_supported_data(
          self.supported_data(), training_trackers
      )
  
      (
          trackers_as_states,
          trackers_as_actions,
      ) = self.featurizer.training_states_and_labels(
          training_trackers, domain
      )
      self.lookup = self._create_lookup_from_states(
          trackers_as_states, trackers_as_actions
      )
      logger.debug(f"Memorized {len(self.lookup)} unique examples.")
  
      self.persist()
      return self._resource
  
imports: from __future__ import annotations
  import copy
  import zlib
  import base64
  import json
  import logging
  import structlog
  from tqdm import tqdm
  from typing import Optional, Any, Dict, List, Text
  from pathlib import Path
  import rasa.utils.io
  import rasa.shared.utils.io
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.core.domain import State, Domain
  from rasa.shared.core.events import ActionExecuted
  from rasa.core.featurizers.tracker_featurizers import TrackerFeaturizer
  from rasa.core.featurizers.tracker_featurizers import MaxHistoryTrackerFeaturizer
  from rasa.core.featurizers.tracker_featurizers import FEATURIZER_FILE
  from rasa.shared.exceptions import FileIOException
  from rasa.core.policies.policy import PolicyPrediction, Policy, SupportedData
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.shared.core.generator import TrackerWithCachedStates
  from rasa.shared.utils.io import is_logging_disabled
  from rasa.core.constants import MEMOIZATION_POLICY_PRIORITY, DEFAULT_MAX_HISTORY, POLICY_MAX_HISTORY, POLICY_PRIORITY
  from rasa.shared.core.constants import ACTION_LISTEN_NAME
label_desc: Use image node_id 6 for calling the MemoizationPolicy obj's underlying member method code with example usage: obj.train(training_trackers, domain) and returns: self