code: def test_story_visualization_with_training_data(
      domain: Domain, tmp_path: Path, nlu_data_path: Text
  ):
      import rasa.shared.core.training_data.loading as core_loading
  
      story_steps = core_loading.load_data_from_resource(
          "data/test_yaml_stories/stories.yml", domain
      )
      out_file = tmp_path / "graph.html"
      test_text = "test text"
      test_intent = "affirm"
      generated_graph = visualization.visualize_stories(
          story_steps,
          domain,
          output_file=str(out_file),
          max_history=3,
          should_merge_nodes=False,
          nlu_training_data=TrainingData(
              [Message({TEXT: test_text, INTENT: test_intent})]
          ),
      )
  
      assert test_text in out_file.read_text()
      assert test_intent not in out_file.read_text()
  
      assert len(generated_graph.nodes()) == 51
      assert len(generated_graph.edges()) == 56
  
imports: from pathlib import Path
  from typing import Text
  import rasa.shared.utils.io
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.events import ActionExecuted, SlotSet, UserUttered
  from rasa.shared.core.training_data import visualization
  import rasa.utils.io
  from rasa.shared.nlu.constants import TEXT, INTENT
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
  import pytest
label_desc: Use image node_id 9 for calling a global function with example usage: test_story_visualization_with_training_data(domain, tmp_path, nlu_data_path) without return types