code: def test_check_consistent_bilou_tagging(
      tags: List[Text],
      confidences: List[float],
      expected_tags: List[Text],
      expected_confidences: List[float],
      debug_message: Optional[Text],
      caplog: LogCaptureFixture,
  ):
      with caplog.at_level(logging.DEBUG):
          (
              actual_tags,
              actual_confidences,
          ) = bilou_utils.ensure_consistent_bilou_tagging(
              tags, confidences
          )
  
      if debug_message:
          assert len(caplog.records) > 0
          assert debug_message in caplog.text
      else:
          assert len(caplog.records) == 0
  
      assert actual_tags == expected_tags
      assert actual_confidences == expected_confidences
  
file_path: rasa/tests/nlu/utils/test_bilou_utils.py
imports: import logging
  from typing import Text, List, Optional
  from _pytest.logging import LogCaptureFixture
  import pytest
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  import rasa.nlu.utils.bilou_utils
  from rasa.nlu.constants import BILOU_ENTITIES
  from rasa.shared.nlu.constants import ENTITIES
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
label_desc: Use image node_id 6 for calling a global function with example usage: test_check_consistent_bilou_tagging(tags, confidences, expected_tags, expected_confidences, debug_message, caplog) without return types