code: def test_most_likely_entity(
      crf_entity_extractor: Callable[
          [Dict[Text, Any]], CRFEntityExtractor
      ],
      entity_predictions: List[Dict[Text, float]],
      expected_label: Text,
      expected_confidence: float,
  ):
      crf_extractor = crf_entity_extractor({"BILOU_flag": True})
  
      actual_label, actual_confidence = crf_extractor._most_likely_tag(
          entity_predictions
      )
  
      assert actual_label == expected_label
      assert actual_confidence == expected_confidence
  
imports: import copy
  from typing import Dict, Text, List, Any, Callable
  import pytest
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.featurizers.dense_featurizer.spacy_featurizer import SpacyFeaturizer
  from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
  from rasa.nlu.constants import SPACY_DOCS
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.nlu.utils.spacy_utils import SpacyModel, SpacyNLP
  from rasa.shared.importers.rasa import RasaFileImporter
  from rasa.shared.nlu.constants import TEXT, ENTITIES
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.extractors.crf_entity_extractor import CRFEntityExtractor, CRFEntityExtractorOptions
label_desc: Use image node_id 4 for calling a global function with example usage: test_most_likely_entity(crf_entity_extractor, entity_predictions, expected_label, expected_confidence) without return types