code: def load_vocab(vocab_file: str) -> List:
      """Loads a vocabulary file into a dictionary."""
      vocab = collections.OrderedDict()
      with io.open(vocab_file, "r", encoding="UTF-8") as file:
          for num, line in enumerate(file):
              items = convert_to_unicode(line.strip()).split("\t")
              if len(items) > 2:
                  break
              token = items[0]
              index = items[1] if len(items) == 2 else num
              token = token.strip()
              vocab[token] = int(index)
  
          return vocab
  
imports: import collections
  import io
  import pickle
  import unicodedata
  from typing import List, Union
label_desc: Use image node_id 2 for calling a global function with example usage: load_vocab(vocab_file) and returns: vocab