code: def bilou_tags_from_offsets(
      tokens: List["Token"], entities: List[Tuple[int, int, Text]]
  ) -> List[Text]:
      """Creates BILOU tags for the given tokens and entities.
  
      Args:
          message: The message object.
          tokens: The list of tokens.
          entities: The list of start, end, and tag tuples.
          missing: The tag for missing entities.
  
      Returns:
          BILOU tags.
      """
      start_pos_to_token_idx = {
          token.start: i for i, token in enumerate(tokens)
      }
      end_pos_to_token_idx = {
          token.end: i for i, token in enumerate(tokens)
      }
  
      bilou = [NO_ENTITY_TAG for _ in tokens]
  
      _add_bilou_tags_to_entities(
          bilou, entities, end_pos_to_token_idx, start_pos_to_token_idx
      )
  
      return bilou
  
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 9 for calling a global function with example usage: bilou_tags_from_offsets(tokens, entities) and returns: bilou