code: def add_word(self, word):
      if not word in self.word2idx:
          self.word2idx[word] = self.idx
          self.idx2word[self.idx] = word
          self.idx += 1
  
file_path: pytorch-tutorial/tutorials/02-intermediate/language_model/data_utils.py
imports: import torch
  import os
label_desc: Use image node_id 2 for calling the Dictionary obj's underlying member method code with example usage: obj.add_word(word) without return types