class_docstr: Mock Dictionary Agent which just implements indexing and txt2vec.
class_docstr_tok: ["Mock","Dictionary","Agent","which","just","implements","indexing","and","txt2vec","."]
docstr: Return index of special token or return the token.
docstr_tok: ["Return","index","of","special","token","or","return","the","token","."]
code: def __getitem__(self, key):
      """
      Return index of special token or return the token.
      """
      if key == self.null_token:
          return self.NULL_IDX
      elif key == self.start_token:
          return self.BEG_IDX
      elif key == self.end_token:
          return self.END_IDX
      elif key == self.p1_token:
          return self.P1_IDX
      elif key == self.p2_token:
          return self.P2_IDX
      else:
          self.idx += 1
          return self.idx
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.torch_agent import TorchAgent, Output
  import torch
  from parlai.core.agents import Agent
label_desc: Use image node_id 2 for calling the MockDict obj's underlying member method code with example usage: obj.__getitem__(key) and returns: self, self, self, self, self, self