code: def load_vocab(fp: IO[bytes]) -> Dict[str, int]:
      """Loads a vocabulary file into a dictionary."""
      vocab: Dict[str, int] = {}
  
      reader = io.TextIOWrapper(fp, encoding="utf-8")
      for token in reader.readlines():
          if token[-1] == "\n":
              token = token[:-1]
          if len(token) == 0:
              continue
          vocab[token] = len(vocab)
      return vocab
  
imports: import pkg_resources
  import io
  from typing import IO, Dict, List, Optional, Tuple
label_desc: Use image node_id 1 for calling a global function with example usage: load_vocab(fp) and returns: vocab