class_docstr: This version of SQuAD 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 default `act` function.
  
  For SQuAD, this does not efficiently store the paragraphs in memory.
class_docstr_tok: ["This","version","of","SQuAD","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","default","`","act","`","function",".","For","SQuAD",",","this","does","not","efficiently","store","the","paragraphs","in","memory","."]
code: def setup_data(self, path):
      print("loading: " + path)
      with PathManager.open(path) as data_file:
          self.squad = json.load(data_file)["data"]
      for article in self.squad:
          # each paragraph is a context for the attached questions
          for paragraph in article["paragraphs"]:
              # each question is an example
              for qa in paragraph["qas"]:
                  question = qa["question"]
                  answers = tuple(a["text"] for a in qa["answers"])
                  context = paragraph["context"]
                  yield (context + "\n" + question, answers), True
  
imports: import copy
  import json
  import os
  from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.teachers import FixedDialogTeacher, DialogTeacher, ParlAIDialogTeacher
  from parlai.tasks.wrapper.agents import AbstractWrapperTeacher
  from parlai.utils.io import PathManager
  from .build import build
label_desc: Use image node_id 2 for calling the DefaultTeacher obj's underlying member method code with example usage: obj.setup_data(path) without return types