code: def test_generate_training_data_with_cycles(domain: Domain):
      featurizer = MaxHistoryTrackerFeaturizer(
          SingleStateFeaturizer(), max_history=4
      )
      training_trackers = training.load_data(
          "data/test_yaml_stories/stories_with_cycle.yml",
          domain,
          augmentation_factor=0,
      )
  
      _, label_ids, _ = featurizer.featurize_trackers(
          training_trackers, domain, precomputations=None
      )
  
      # how many there are depends on the graph which is not created in a
      # deterministic way but should always be 3 or 4
      assert len(training_trackers) == 3 or len(training_trackers) == 4
  
      # if we have 4 trackers, there is going to be one example more for label 10
      num_tens = len(training_trackers) - 1
      # if new default actions are added the keys of the actions will be changed
  
      all_label_ids = [id for ids in label_ids for id in ids]
      assert Counter(all_label_ids) == {
          0: 6,
          16: 3,
          15: num_tens,
          1: 2,
          17: 1,
      }
  
imports: import json
  import warnings
  import numpy
  import os
  import pytest
  import sys
  from collections import Counter
  from pathlib import Path
  from typing import Any, Text, List, Dict, Optional
  from _pytest.monkeypatch import MonkeyPatch
  from unittest.mock import Mock
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.training_data.message import Message
  import rasa.shared.utils.io
  from rasa.shared.exceptions import FileNotFoundException, YamlSyntaxException, YamlException
  from rasa.core.actions.action import ACTION_LISTEN_NAME
  from rasa.core import training
  from rasa.core.featurizers.tracker_featurizers import MaxHistoryTrackerFeaturizer
  from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
  from rasa.utils.tensorflow.model_data_utils import _surface_attributes
  from rasa.shared.constants import INTENT_MESSAGE_PREFIX, LATEST_TRAINING_DATA_FORMAT_VERSION
  from rasa.shared.core.constants import RULE_SNIPPET_ACTION_NAME
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.training_data import loading
  from rasa.shared.core.events import ActionExecuted, UserUttered, SlotSet, ActiveLoop
  from rasa.shared.core.training_data.story_reader.yaml_story_reader import YAMLStoryReader, DEFAULT_VALUE_TEXT_SLOTS
  from rasa.shared.core.training_data.structures import StoryStep, RuleStep
  from rasa.shared.nlu.constants import ACTION_NAME, ENTITIES, ENTITY_ATTRIBUTE_END, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_VALUE, FEATURE_TYPE_SENTENCE, INTENT, INTENT_NAME_KEY, INTENT_RANKING_KEY, PREDICTED_CONFIDENCE_KEY, TEXT, EXTRACTOR
  from tests.conftest import filter_expected_warnings
label_desc: Use image node_id 31 for calling a global function with example usage: test_generate_training_data_with_cycles(domain) without return types