code: def vocab_to_hashtable(
      vocab: vocabulary.Vocabulary, unk_idx: int
  ) -> tf.lookup.StaticHashTable:
      """Returns a TF lookup table (token -> ID) from a vocabulary."""
      return tf.lookup.StaticHashTable(
          tf.lookup.KeyValueTensorInitializer(
              list(vocab.keys()), list(vocab.values())
          ),
          default_value=unk_idx,
      )
  
imports: from typing import Any, Dict, Optional
  from absl import logging
  import numpy
  import tensorflow
  import tensorflow_datasets
  import tensorflow_text
  import vocabulary
label_desc: Use image node_id 4 for calling a global function with example usage: vocab_to_hashtable(vocab, unk_idx) and returns: tf