code: def __init__(self, vocab_file, data_dir=None):
      if not PathManager.exists(vocab_file) and data_dir is not None:
          vocab_file = get_absolute_path(
              os.path.join(data_dir, vocab_file)
          )
  
      if not PathManager.exists(vocab_file):
          raise RuntimeError(
              f"Vocab file {vocab_file} for vocab dict doesn't exist"
          )
  
      self.word_list = load_str_list(vocab_file)
      self._build()
  
imports: import os
  import re
  from collections import Counter
  from itertools import chain
  import torch
  from mmf.common.registry import registry
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
label_desc: Use image node_id 1 to create a new VocabDict object  with example: obj = VocabDict(vocab_file, data_dir)