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: Creates a duplicate of this tracker.
  
  A new tracker will be created and all events
  will be replayed.
docstr_tok: ["Creates","a","duplicate","of","this","tracker",".","A","new","tracker","will","be","created","and","all","events","will","be","replayed","."]
code: def copy(
      self, sender_id: Text = "", sender_source: Text = ""
  ) -> "TrackerWithCachedStates":
      """Creates a duplicate of this tracker.
  
      A new tracker will be created and all events
      will be replayed.
      """
      # This is an optimization, we could use the original copy, but
      # the states would be lost and we would need to recalculate them
  
      tracker = self.init_copy()
      tracker.sender_id = sender_id
      tracker.sender_source = sender_source
  
      with tracker._skip_states_manager():
          for event in self.events:
              tracker.update(event)
  
      tracker._states_for_hashing = copy.copy(self._states_for_hashing)
  
      return tracker
  
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 9 for calling the TrackerWithCachedStates obj's underlying member method code with example usage: obj.copy(sender_id, sender_source) and returns: tracker