code: def add_word(self, word):
      if word not in self.word2idx:
          self.idx2word.append(word)
          self.word2idx[word] = len(self.idx2word) - 1
      return self.word2idx[word]
  
file_path: skorch/examples/word_language_model/data.py
imports: import os
  from skorch.utils import to_device
  import torch
  from torch.autograd import Variable
label_desc: Use image node_id 2 for calling the Dictionary obj's underlying member method code with example usage: obj.add_word(word) and returns: self