class_docstr: This version of MNIST inherits from the core Dialog Teacher, which just requires it
  to define an iterator over its data `setup_data` in order to inherit basic metrics,
  a `act` function, and enables Hogwild training with shared memory with no extra
  work.
class_docstr_tok: ["This","version","of","MNIST","inherits","from","the","core","Dialog","Teacher",",","which","just","requires","it","to","define","an","iterator","over","its","data","`","setup_data","`","in","order","to","inherit","basic","metrics",",","a","`","act","`","function",",","and","enables","Hogwild","training","with","shared","memory","with","no","extra","work","."]
code: def setup_data(self, path):
      print("loading: " + path)
      with PathManager.open(path) as labels_file:
          self.labels = json.load(labels_file)
  
      self.question = "Which number is in the image?"
      episode_done = True
  
      for i in range(len(self.labels)):
          img_path = os.path.join(self.image_path, "%05d.bmp" % i)
          label = [self.labels[i], self.num_strs[int(self.labels[i])]]
          yield (
              self.question,
              label,
              None,
              None,
              img_path,
          ), episode_done
  
file_path: ParlAI/parlai/tasks/mnist_qa/agents.py
imports: from parlai.core.teachers import DialogTeacher
  from parlai.utils.io import PathManager
  from .build import build
  import json
  import os
label_desc: Use image node_id 3 for calling the MnistQATeacher obj's underlying member method code with example usage: obj.setup_data(path) without return types