code: def build_vocab(data: tp.List[tp.List[str]]) -> Dictionary:
      d = Dictionary()
      for s in data:
          for token in s:
              d.add_symbol(token)
      d.finalize()
      return d
  
file_path: fairseq/tests/test_binarizer.py
imports: import os
  import typing
  import unittest
  from tempfile import TemporaryDirectory
  from fairseq.binarizer import BinarizeSummary, FileBinarizer, VocabularyDatasetBinarizer
  from fairseq.data import Dictionary, indexed_dataset
  from tests.utils import make_data, sizes
label_desc: Use image node_id 1 for calling a global function with example usage: build_vocab(data) and returns: d