code: def test_data_split_stories(
      run_in_simple_project: Callable[..., RunResult]
  ):
      stories_yml = (
          "stories:\n"
          "- story: story 1\n"
          "  steps:\n"
          "  - intent: intent_a\n"
          "  - action: utter_a\n"
          "- story: story 2\n"
          "  steps:\n"
          "  - intent: intent_a\n"
          "  - action: utter_a\n"
      )
  
      Path("data/stories.yml").write_text(stories_yml)
      run_in_simple_project(
          "data",
          "split",
          "stories",
          "--random-seed",
          "123",
          "--training-fraction",
          "0.5",
      )
  
      folder = Path("train_test_split")
      assert folder.exists()
  
      train_file = folder / "train_stories.yml"
      assert train_file.exists()
      test_file = folder / "test_stories.yml"
      assert test_file.exists()
  
      train_data = rasa.shared.utils.io.read_yaml_file(train_file)
      assert len(train_data.get("stories", [])) == 1
      assert train_data["stories"][0].get("story") == "story 1"
      test_data = rasa.shared.utils.io.read_yaml_file(test_file)
      assert len(test_data.get("stories", [])) == 1
      assert test_data["stories"][0].get("story") == "story 2"
  
file_path: rasa/tests/cli/test_rasa_data.py
imports: import os
  from pathlib import Path
  from typing import Callable
  from _pytest.fixtures import FixtureRequest
  from _pytest.pytester import RunResult
  from rasa.shared.nlu.training_data.formats import RasaYAMLReader
  import rasa.shared.utils.io
  from tests.cli.conftest import RASA_EXE
label_desc: Use image node_id 11 for calling a global function with example usage: test_data_split_stories(run_in_simple_project) without return types