code: def get_no_of_stories(story_file: Text, domain: Text) -> int:
      """Gets number of stories in a file."""
      importer = TrainingDataImporter.load_from_dict(
          domain_path=domain, training_data_paths=[story_file]
      )
      story_graph = importer.get_stories()
      return len(story_graph.story_steps)
  
file_path: rasa/rasa/core/train.py
imports: import argparse
  import logging
  import os
  from pathlib import Path
  from typing import Dict, Optional, Text, List
  import rasa.shared.utils.io
  import rasa.utils.io
  from rasa.constants import NUMBER_OF_TRAINING_STORIES_FILE, PERCENTAGE_KEY
  from rasa.shared.importers.importer import TrainingDataImporter
label_desc: Use image node_id 2 for calling a global function with example usage: get_no_of_stories(story_file, domain) and returns: len