code: def get_core_directory(
      paths: Optional[Union[Text, List[Text]]]
  ) -> Text:
      """Recursively collects all Core training files from a list of paths.
  
      Args:
          paths: List of paths to training files or folders containing them.
  
      Returns:
          Path to temporary directory containing all found Core training files.
      """
      from rasa.shared.core.training_data.story_reader.yaml_story_reader import (
          YAMLStoryReader,
      )
  
      core_files = get_data_files(
          paths, YAMLStoryReader.is_stories_file
      )
      return _copy_files_to_new_dir(core_files)
  
imports: import os
  import shutil
  import tempfile
  import uuid
  from enum import Enum
  from pathlib import Path
  from typing import Text, Optional, Union, List, Callable, Set, Iterable
label_desc: Use image node_id 4 for calling a global function with example usage: get_core_directory(paths) and returns: _copy_files_to_new_dir