code: def apply_bilou_schema_to_message(message: "Message") -> None:
      """Get a list of BILOU entity tags and set them on the given message.
  
      Args:
          message: the message
      """
      entities = message.get(ENTITIES)
  
      if not entities:
          return
  
      tokens = message.get(TOKENS_NAMES[TEXT])
  
      for attribute, message_key in [
          (ENTITY_ATTRIBUTE_TYPE, BILOU_ENTITIES),
          (ENTITY_ATTRIBUTE_ROLE, BILOU_ENTITIES_ROLE),
          (ENTITY_ATTRIBUTE_GROUP, BILOU_ENTITIES_GROUP),
      ]:
          entities = map_message_entities(message, attribute)
          output = bilou_tags_from_offsets(tokens, entities)
          message.set(message_key, output)
  
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 7 for calling a global function with example usage: apply_bilou_schema_to_message(message) without return types