code: def get_tag_ids(
      example: Message, tag_spec: "EntityTagSpec", bilou_tagging: bool
  ) -> "Features":
      """Creates a feature array containing the entity tag ids of the given example.
  
      Args:
          example: the message
          tag_spec: entity tag spec
          bilou_tagging: indicates whether BILOU tagging should be used or not
  
      Returns:
          A list of features.
      """
      from rasa.nlu.test import determine_token_labels
      from rasa.nlu.utils.bilou_utils import bilou_tags_to_ids
      from rasa.shared.nlu.training_data.features import Features
  
      if bilou_tagging:
          _tags = bilou_tags_to_ids(
              example, tag_spec.tags_to_ids, tag_spec.tag_name
          )
      else:
          _tags = []
          for token in example.get(TOKENS_NAMES[TEXT]):
              _tag = determine_token_labels(
                  token,
                  example.get(ENTITIES),
                  attribute_key=tag_spec.tag_name,
              )
              _tags.append(tag_spec.tags_to_ids[_tag])
  
      # transpose to have seq_len x 1
      return Features(
          np.array([_tags]).T, IDS, tag_spec.tag_name, TAG_ID_ORIGIN
      )
  
imports: import typing
  import copy
  import numpy
  import scipy.sparse
  from collections import defaultdict, OrderedDict
  from typing import List, Optional, Text, Dict, Tuple, Union, Any, DefaultDict, cast
  from rasa.nlu.constants import TOKENS_NAMES
  from rasa.utils.tensorflow.model_data import Data, FeatureArray, ragged_array_to_ndarray
  from rasa.utils.tensorflow.constants import MASK, IDS
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.constants import TEXT, ENTITIES, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE
label_desc: Use image node_id 3 for calling a global function with example usage: get_tag_ids(example, tag_spec, bilou_tagging) and returns: Features