class_docstr: Generates trackers from training data.
class_docstr_tok: ["Generates","trackers","from","training","data","."]
docstr: Processes a steps events with all trackers.
  
  The trackers that reached the steps starting checkpoint will
  be used to process the events. Collects and returns training
  data while processing the story step.
docstr_tok: ["Processes","a","steps","events","with","all","trackers",".","The","trackers","that","reached","the","steps","starting","checkpoint","will","be","used","to","process","the","events",".","Collects","and","returns","training","data","while","processing","the","story","step","."]
code: def _process_step(
      self,
      step: StoryStep,
      incoming_trackers: List[TrackerWithCachedStates],
  ) -> TrackersTuple:
      """Processes a steps events with all trackers.
  
      The trackers that reached the steps starting checkpoint will
      be used to process the events. Collects and returns training
      data while processing the story step.
      """
      events = step.explicit_events(self.domain)
  
      trackers = []
      if events:  # small optimization
          # need to copy the tracker as multiple story steps
          # might start with the same checkpoint and all of them
          # will use the same set of incoming trackers
  
          for tracker in incoming_trackers:
              # sender id is used to be able for a human to see where the
              # messages and events for this tracker came from - to do this
              # we concatenate the story block names of the blocks that
              # contribute to the trackers events
              if tracker.sender_id:
                  if (
                      step.block_name
                      and step.block_name
                      not in tracker.sender_id.split(" > ")
                  ):
                      new_sender = (
                          tracker.sender_id + " > " + step.block_name
                      )
                  else:
                      new_sender = tracker.sender_id
              else:
                  new_sender = step.block_name
              trackers.append(
                  tracker.copy(new_sender, step.source_name)
              )
  
      end_trackers = []
      for event in events:
          if (
              isinstance(event, ActionExecuted)
              and event.action_text
              and event.action_text not in self.domain.action_texts
          ):
              rasa.shared.utils.cli.print_warning(
                  f"Test story '{step.block_name}' in "
                  f"'{step.source_name}' contains the bot utterance "
                  f"'{event.action_text}', which is not part "
                  f"of the training data / domain."
              )
          for tracker in trackers:
              if isinstance(
                  event,
                  (ActionReverted, UserUtteranceReverted, Restarted),
              ):
                  end_trackers.append(tracker.copy(tracker.sender_id))
              if isinstance(step, RuleStep):
                  # The rules can specify that a form or a slot shouldn't be set,
                  # therefore we need to distinguish between not set
                  # and explicitly set to None
                  if (
                      isinstance(event, ActiveLoop)
                      and event.name is None
                  ):
                      event.name = SHOULD_NOT_BE_SET
  
                  if isinstance(event, SlotSet) and event.value is None:
                      event.value = SHOULD_NOT_BE_SET
  
              tracker.update(event)
  
      # end trackers should be returned separately
      # to avoid using them for augmentation
      return trackers, end_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 13 for calling the TrainingDataGenerator obj's underlying member method code with example usage: obj._process_step(step, incoming_trackers) and returns: trackers,  end_trackers