code: def __init__(self, id2word, word2id, counts):
      assert len(id2word) == len(word2id) == len(counts)
      self.id2word = id2word
      self.word2id = word2id
      self.counts = counts
      self.bos_index = word2id[BOS_WORD]
      self.eos_index = word2id[EOS_WORD]
      self.pad_index = word2id[PAD_WORD]
      self.unk_index = word2id[UNK_WORD]
      self.check_valid()
  
file_path: pytext/pytext/data/xlm_dictionary.py
imports: import os
  from logging import getLogger
  import numpy
  import torch
  from pytext.utils.file_io import PathManager
label_desc: Use image node_id 1 to create a new Dictionary object from inherited base classes: object with example: obj = Dictionary(id2word, word2id, counts)