code: def test_train_core_with_original_or_provided_domain_and_compare(
      tmp_path_factory: TempPathFactory,
      default_model_storage: ModelStorage,
      default_execution_context: ExecutionContext,
  ):
      # Choose an example where the provider will remove a lot of information:
      example = Path("examples/formbot/")
      training_files = [example / "data" / "rules.yml"]
  
      # Choose a configuration with a policy
      # Note: This is sufficient to illustrate that the component won't be re-trained
      # when the domain changes. We do *not* test here whether removing keys would/
      # should not have any effect.
      config = """
      recipe: default.v1
      language: en
  
      policies:
        - name: RulePolicy
      """
      config_dir = tmp_path_factory.mktemp("config dir")
      config_file = config_dir / "config.yml"
      with open(config_file, "w") as f:
          f.write(config)
  
      # Train with the original domain
      original_domain_file = example / "domain.yml"
      original_output_dir = tmp_path_factory.mktemp("output dir")
      model_training.train(
          domain=original_domain_file,
          config=str(config_file),
          training_files=training_files,
          output=original_output_dir,
      )
  
      # Let the provider create a modified domain
      original_domain = Domain.from_file(original_domain_file)
      component = DomainForCoreTrainingProvider.create(
          {"arbitrary-unused": 234},
          default_model_storage,
          Resource("xy"),
          default_execution_context,
      )
      modified_domain = component.provide(domain=original_domain)
  
      # Dry-run training with the modified domain
      modified_domain_dir = tmp_path_factory.mktemp(
          "modified domain dir"
      )
      modified_domain_file = modified_domain_dir / "modified_config.yml"
      modified_domain.persist(modified_domain_file)
  
      modified_output_dir = tmp_path_factory.mktemp(
          "modified output dir"
      )
      modified_result = model_training.train(
          domain=modified_domain_file,
          config=str(config_file),
          training_files=training_files,
          output=modified_output_dir,
          dry_run=True,
      )
  
      assert modified_result.dry_run_results["train_RulePolicy0"].is_hit
  
file_path: rasa/tests/graph_components/providers/test_domain_for_core_training_provider.py
imports: from typing import Text, Union, Dict
  import pytest
  from pathlib import Path
  from _pytest.tmpdir import TempPathFactory
  from rasa import model_training
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.core.domain import KEY_RESPONSES, Domain, SESSION_CONFIG_KEY, KEY_FORMS, SESSION_EXPIRATION_TIME_KEY, CARRY_OVER_SLOTS_KEY
  from rasa.graph_components.providers.domain_for_core_training_provider import DomainForCoreTrainingProvider
  from rasa.shared.constants import REQUIRED_SLOTS_KEY
label_desc: Use image node_id 2 for calling a global function with example usage: test_train_core_with_original_or_provided_domain_and_compare(tmp_path_factory, default_model_storage, default_execution_context) without return types