code: def test_graph_persistence(domain: Domain, tmp_path: Path):
      from os.path import isfile
      from networkx.drawing import nx_pydot
      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 = str(tmp_path / "graph.html")
      generated_graph = visualization.visualize_stories(
          story_steps,
          domain,
          output_file=out_file,
          max_history=3,
          should_merge_nodes=False,
      )
  
      generated_graph = nx_pydot.to_pydot(generated_graph)
  
      assert isfile(out_file)
  
      content = rasa.shared.utils.io.read_file(out_file)
  
      assert "isClient = true" in content
      assert (
          "graph = `{}`".format(generated_graph.to_string()) in content
      )
  
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 6 for calling a global function with example usage: test_graph_persistence(domain, tmp_path) without return types