code: def test_validate_after_removing_or_adding_intent_or_action_name(
      get_validation_method: Callable[..., ValidationMethodType],
      nlu: bool,
      core: bool,
      key: Text,
  ):
      messages = [
          Message(data={key: "item-1"}),
          Message(data={key: "item-2"}),
      ]
      message_with_new_item = Message(data={key: "item-3"})
  
      # training
      importer = DummyNLUDataImporter(messages)
      validate = get_validation_method(
          finetuning=False, load=False, nlu=nlu, core=core
      )
      validate(importer=importer)
  
      # load validate method in finetuning mode
      validate = get_validation_method(
          finetuning=True, load=True, nlu=nlu, core=core
      )
  
      # ... apply with something suddenly missing
      importer2 = DummyNLUDataImporter(messages[1:])
      if nlu:
          with pytest.raises(InvalidConfigException):
              validate(importer=importer2)
      else:
          validate(importer=importer2)
  
      # ... apply with additional item
      importer3 = DummyNLUDataImporter(
          messages + [message_with_new_item]
      )
      if nlu:
          with pytest.raises(InvalidConfigException):
              validate(importer=importer3)
      else:
          validate(importer=importer3)
  
imports: import os
  from pathlib import Path
  import copy
  from typing import Callable, List, Optional, Text, Dict, Any
  from _pytest.monkeypatch import MonkeyPatch
  import pytest
  from rasa.engine.graph import ExecutionContext, GraphComponent, GraphSchema, SchemaNode
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.graph_components.validators.finetuning_validator import FinetuningValidator
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.core.policies.rule_policy import RulePolicy
  from rasa.shared.constants import DEFAULT_CONFIG_PATH, DEFAULT_DATA_PATH, DEFAULT_DOMAIN_PATH
  from rasa.shared.core.domain import KEY_RESPONSES, Domain
  from rasa.shared.importers.rasa import RasaFileImporter
  from rasa.shared.importers.importer import NluDataImporter, TrainingDataImporter
  import rasa.shared.utils.io
  from rasa.shared.exceptions import InvalidConfigException
  from rasa.shared.nlu.constants import ACTION_NAME, INTENT, TEXT
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
label_desc: Use image node_id 14 for calling a global function with example usage: test_validate_after_removing_or_adding_intent_or_action_name(get_validation_method, nlu, core, key) without return types