code: def get_list_t5_tokenize(max_num_tokens, prompt=None):
      """Tokenizes a text using T5 Tokenizer."""
  
      tokenizer = t5_tokenizer.build_dmvr_sp_model()
      tokenizer.initialize()
      if prompt is None:
          prompt = [BOS_ID]
      else:
          prompt = tokenizer.string_to_indices(
              prompt, max_num_tokens=None
          )
          prompt = tf.concat([[BOS_ID], prompt], axis=-1)
  
      def add_prompt(tokens):
          return tf.concat([prompt, tokens], axis=-1)
  
      def _list_t5_tokenize(texts):
          if texts.shape.ndims == 0:
              texts = tf.reshape(texts, (-1,))
          token_list = tokenizer.string_tensor_to_indices(
              string_tensor=texts,
              max_num_tokens=max_num_tokens,
              append_eos=True,
          )
          token_list = tf.stack(
              tf.map_fn(add_prompt, token_list), axis=0
          )
          return tf.cast(token_list, tf.int16)
  
      return _list_t5_tokenize
  
imports: import functools
  from big_vision.datasets.imagenet import class_names
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib.big_transfer import registry
  from scenic.dataset_lib.big_transfer.preprocessing import utils
  from scenic.projects.t5 import tokenizer
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: get_list_t5_tokenize(max_num_tokens, prompt) and returns: _list_t5_tokenize, tf, tf