class_docstr: This teacher 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, and enables Hogwild training with shared memory with no extra work.
class_docstr_tok: ["This","teacher","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",",","and","enables","Hogwild","training","with","shared","memory","with","no","extra","work","."]
code: def setup_data(self, path):
      print("loading: " + path)
      with PathManager.open(path, "r", newline="") as read:
          csv_read = csv.reader(read)
          next(csv_read)  # eat header
  
          for line in csv_read:
              fields = [
                  s.replace("__eou__", ".")
                  .replace("__eot__", "\n")
                  .strip()
                  for s in line
              ]
              context = fields[0]
              response = fields[1]
              cands = None
              if len(fields) > 3:
                  cands = [fields[i] for i in range(2, len(fields))]
                  cands.append(response)
                  random.shuffle(cands)
              yield (context, [response], None, cands), True
  
imports: from parlai.core.teachers import DialogTeacher, FixedDialogTeacher
  from parlai.utils.io import PathManager
  from .build import build
  import csv
  import random
  import os
label_desc: Use image node_id 2 for calling the UbuntuTeacher obj's underlying member method code with example usage: obj.setup_data(path) without return types