code: def _add_bilou_tags_to_entities(
      bilou: List[Text],
      entities: List[Tuple[int, int, Text]],
      end_pos_to_token_idx: Dict[int, int],
      start_pos_to_token_idx: Dict[int, int],
  ) -> None:
      for start_pos, end_pos, label in entities:
          start_token_idx = start_pos_to_token_idx.get(start_pos)
          end_token_idx = end_pos_to_token_idx.get(end_pos)
  
          # Only interested if the tokenization is correct
          if start_token_idx is not None and end_token_idx is not None:
              if start_token_idx == end_token_idx:
                  bilou[start_token_idx] = f"{UNIT}{label}"
              else:
                  bilou[start_token_idx] = f"{BEGINNING}{label}"
                  for i in range(start_token_idx + 1, end_token_idx):
                      bilou[i] = f"{INSIDE}{label}"
                  bilou[end_token_idx] = f"{LAST}{label}"
  
imports: import logging
  import operator
  from collections import defaultdict, Counter
  from typing import List, Tuple, Text, Optional, Dict, Any, TYPE_CHECKING
  from rasa.nlu.constants import TOKENS_NAMES, BILOU_ENTITIES, BILOU_ENTITIES_GROUP, BILOU_ENTITIES_ROLE
  from rasa.shared.nlu.constants import TEXT, ENTITIES, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE, NO_ENTITY_TAG
label_desc: Use image node_id 10 for calling a global function with example usage: _add_bilou_tags_to_entities(bilou, entities, end_pos_to_token_idx, start_pos_to_token_idx) without return types