code: def train_core(
      domain: Union[Domain, Text],
      config: Text,
      stories: Text,
      output: Text,
      fixed_model_name: Optional[Text] = None,
      additional_arguments: Optional[Dict] = None,
      model_to_finetune: Optional[Text] = None,
      finetuning_epoch_fraction: float = 1.0,
  ) -> Optional[Text]:
      """Trains a Core model.
  
      Args:
          domain: Path to the domain file.
          config: Path to the config file for Core.
          stories: Path to the Core training data.
          output: Output path.
          fixed_model_name: Name of model to be stored.
          additional_arguments: Additional training parameters.
          model_to_finetune: Optional path to a model which should be finetuned or
              a directory in case the latest trained model should be used.
          finetuning_epoch_fraction: The fraction currently specified training epochs
              in the model configuration which should be used for finetuning.
  
      Returns:
          Path to the model archive.
  
      """
      file_importer = (
          TrainingDataImporter.load_core_importer_from_config(
              config, domain, [stories], additional_arguments
          )
      )
      stories_data = file_importer.get_stories()
      nlu_data = file_importer.get_nlu_data()
      domain = file_importer.get_domain()
  
      if nlu_data.has_e2e_examples():
          rasa.shared.utils.cli.print_error(
              "Stories file contains e2e stories. Please train using `rasa train` so that"
              " the NLU model is also trained."
          )
          return None
  
      if domain.is_empty():
          rasa.shared.utils.cli.print_error(
              "Core training was skipped because no valid domain file was found. "
              "Please specify a valid domain using '--domain' argument or check "
              "if the provided domain file exists."
          )
          return None
  
      if not stories_data:
          rasa.shared.utils.cli.print_error(
              "No stories given. Please provide stories in order to "
              "train a Rasa Core model using the '--stories' argument."
          )
          return None
  
      _check_unresolved_slots(domain, stories_data)
  
      return _train_graph(
          file_importer,
          training_type=TrainingType.CORE,
          output_path=output,
          model_to_finetune=model_to_finetune,
          fixed_model_name=fixed_model_name,
          finetuning_epoch_fraction=finetuning_epoch_fraction,
          **(additional_arguments or {}),
      ).model
  
imports: import time
  from pathlib import Path
  from typing import Text, NamedTuple, Optional, List, Union, Dict, Any
  import randomname
  import rasa.engine.validation
  from rasa.engine.caching import LocalTrainingCache
  from rasa.engine.recipes.recipe import Recipe
  from rasa.engine.runner.dask import DaskGraphRunner
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.training.components import FingerprintStatus
  from rasa.engine.training.graph_trainer import GraphTrainer
  from rasa.shared.core.events import SlotSet
  from rasa.shared.core.training_data.structures import StoryGraph
  from rasa.shared.data import TrainingType
  from rasa.shared.importers.importer import TrainingDataImporter
  from rasa import telemetry
  from rasa.shared.core.domain import Domain
  import rasa.utils.common
  import rasa.shared.utils.common
  import rasa.shared.utils.cli
  import rasa.shared.exceptions
  import rasa.shared.utils.io
  import rasa.shared.constants
  import rasa.model
label_desc: Use image node_id 8 for calling a global function with example usage: train_core(domain, config, stories, output, fixed_model_name, additional_arguments, model_to_finetune, finetuning_epoch_fraction) and returns: _train_graph, None, None, None