code: def _migrate_domain_files(
      domain_path: Path, backup_location: Path, out_path: Path
  ) -> Dict[Text, Any]:
      """Migrates files that only need a version update and collects the remaining info.
  
      Moreover, backups will be created from all domain files that can be found in the
      given domain directory.
  
      Args:
          domain_path: directory containing domain files
          backup_location: where to backup all domain files
          out_path: location where to store the migrated files
      """
      slots: Dict[Text, Any] = {}
      forms: Dict[Text, Any] = {}
      entities: List[Any] = []
  
      domain_files = [
          file
          for file in domain_path.iterdir()
          if Domain.is_domain_file(file)
      ]
  
      if not domain_files:
          raise RasaException(
              f"The domain directory '{domain_path.as_posix()}' does not contain any "
              f"domain files. Please make sure to include these for a successful "
              f"migration."
          )
  
      for file in domain_files:
          backup = backup_location / file.name
          original_content = _create_back_up(file, backup)
  
          if (
              KEY_SLOTS not in original_content
              and KEY_FORMS not in original_content
          ):
              if isinstance(original_content, dict):
                  original_content.update(
                      {
                          "version": DoubleQuotedScalarString(
                              LATEST_TRAINING_DATA_FORMAT_VERSION
                          )
                      }
                  )
  
              # this is done so that the other domain files can be moved
              # in the migrated directory
              rasa.shared.utils.io.write_yaml(
                  original_content, out_path / file.name, True
              )
          elif KEY_SLOTS in original_content and slots:
              raise RasaException(
                  f"Domain files with multiple '{KEY_SLOTS}' "
                  f"sections were provided. Please group these sections "
                  f"in one file only to prevent content duplication across "
                  f"multiple files. "
              )
          elif KEY_FORMS in original_content and forms:
              raise RasaException(
                  f"Domain files with multiple '{KEY_FORMS}' "
                  f"sections were provided. Please group these sections "
                  f"in one file only to prevent content duplication across "
                  f"multiple files. "
              )
  
          slots.update(original_content.get(KEY_SLOTS, {}))
          forms.update(original_content.get(KEY_FORMS, {}))
          entities.extend(original_content.get(KEY_ENTITIES, []))
  
      if not slots or not forms:
          raise RasaException(
              f"The files you have provided in '{domain_path}' are missing slots "
              f"or forms. Please make sure to include these for a "
              f"successful migration."
          )
  
      return {
          KEY_SLOTS: slots,
          KEY_FORMS: forms,
          KEY_ENTITIES: entities,
      }
  
imports: import copy
  import shutil
  from pathlib import Path
  from typing import List, Dict, Text, Any, Tuple, Optional, Union
  from ruamel.yaml.scalarstring import DoubleQuotedScalarString
  import rasa.shared.utils.io
  import rasa.shared.utils.cli
  from rasa.shared.constants import REQUIRED_SLOTS_KEY, IGNORED_INTENTS
  from rasa.shared.core.constants import ACTIVE_LOOP, REQUESTED_SLOT, SlotMappingType, MAPPING_TYPE, SLOT_MAPPINGS
  from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
  from rasa.shared.core.domain import KEY_ENTITIES, KEY_SLOTS, KEY_FORMS, Domain
  from rasa.shared.exceptions import RasaException
  from rasa.shared.utils.validation import KEY_TRAINING_DATA_FORMAT_VERSION
label_desc: Use image node_id 10 for calling a global function with example usage: _migrate_domain_files(domain_path, backup_location, out_path) and returns: dict