code: def __init__(self, opt, shared=None):
      # store datatype
      super().__init__(opt, shared)
  
      dt = opt["datatype"].split(":")[0]
      if dt != "train":
          raise RuntimeError("Not valid datatype (only train).")
  
      if shared:
          self.data = shared["data"]
          self.num_ex = shared["num_ex"]
          self.num_ep = shared["num_ep"]
      else:
          build(opt)
          self._setup_data()
          self.num_ex = sum([len(x) for x in self.data])
          self.num_ep = len(self.data)
      self.reset()
  
file_path: ParlAI/parlai/tasks/amazon_qa/agents.py
imports: from parlai.core.teachers import FixedDialogTeacher
  from parlai.utils.io import PathManager
  from .build import build, RESOURCES
  import os
  import json
label_desc: Use image node_id 1 to create a new DefaultTeacher object from inherited base classes: FixedDialogTeacher with example: obj = DefaultTeacher(opt, shared)