class_docstr: Generates trackers from training data.
class_docstr_tok: ["Generates","trackers","from","training","data","."]
docstr: Removes trackers that reached story end and
  created equal featurizations.
docstr_tok: ["Removes","trackers","that","reached","story","end","and","created","equal","featurizations","."]
code: def _remove_duplicate_story_end_trackers(
      self, trackers: List[TrackerWithCachedStates]
  ) -> List[TrackerWithCachedStates]:
      """Removes trackers that reached story end and
      created equal featurizations.
      """
      # collected trackers that created different featurizations
      unique_trackers = []  # for all steps
  
      # deduplication of finished trackers is needed,
      # otherwise featurization does a lot of unnecessary work
  
      for tracker in trackers:
          states_for_hashing = tuple(
              tracker.past_states_for_hashing(self.domain)
          )
          hashed = hash(states_for_hashing + (tracker.is_rule_tracker,))
  
          # only continue with trackers that created a
          # hashed_featurization we haven't observed
  
          if hashed not in self.hashed_featurizations:
              self.hashed_featurizations.add(hashed)
              unique_trackers.append(tracker)
  
      return unique_trackers
  
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 15 for calling the TrainingDataGenerator obj's underlying member method code with example usage: obj._remove_duplicate_story_end_trackers(trackers) and returns: unique_trackers