code: def test_classification(
      message: Text,
      previous_intent: Optional[Dict[Text, Union[str, float]]],
      expected_intent: Dict[Text, Union[str, float]],
      training_data: TrainingData,
      default_keyword_intent_classifier: KeywordIntentClassifier,
  ):
      text = Message(data={TEXT: message, INTENT: previous_intent})
      default_keyword_intent_classifier.train(training_data)
      messages = default_keyword_intent_classifier.process([text])
      for m in messages:
          assert m.get(INTENT) == expected_intent
  
file_path: rasa/tests/nlu/classifiers/test_keyword_classifier.py
imports: from typing import Text, Dict, Any, Optional, Union
  import pytest
  import copy
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.classifiers.keyword_intent_classifier import KeywordIntentClassifier
  from rasa.shared.nlu.constants import TEXT, INTENT, PREDICTED_CONFIDENCE_KEY, INTENT_NAME_KEY
  from rasa.shared.nlu.training_data.formats.rasa import RasaReader
  import rasa.shared.nlu.training_data.loading
  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 4 for calling a global function with example usage: test_classification(message, previous_intent, expected_intent, training_data, default_keyword_intent_classifier) without return types