class_docstr: Dataset of comments from Wikipedia's Talk page edits. Taken from the Toxic Comments
  Classification Challenge on Kaggle.
  
  <https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge/data>
  
  We convert this data to a binary classification task.
class_docstr_tok: ["Dataset","of","comments","from","Wikipedia","'s","Talk","page","edits",".","Taken","from","the","Toxic","Comments","Classification","Challenge","on","Kaggle",".","<","https",":","\/\/www.kaggle.com\/c\/jigsaw-toxic-comment-classification-challenge\/data",">","We","convert","this","data","to","a","binary","classification","task","."]
docstr: Set up the data based on the correct partition flag specified and partition
  accordingly.
code: def _setup_data(self, datatype):
      """
      Set up the data based on the correct partition flag specified and partition
      accordingly.
      """
      if not self.use_test_set:
          dp = os.path.join(
              self.data_path, "wiki-toxic-comments-partition.json"
          )
      else:
          dp = os.path.join(
              self.data_path, "wiki-toxic-comments-default.json"
          )
  
      print("loading: " + dp)
      with PathManager.open(dp, "r") as f:
          self.total_data = json.loads(f.read())
          if "train" in datatype:
              self.data = [
                  x
                  for x in self.total_data
                  if x["data_type"] == "train"
              ]
          elif "test" in datatype:
              self.data = [
                  x for x in self.total_data if x["data_type"] == "test"
              ]
          else:
              self.data = [
                  x
                  for x in self.total_data
                  if x["data_type"] == "valid"
              ]
  
      if self.balance_data and "train" in datatype:
          self.data = self._balance_data(self.data)
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import parlai.core.build_data
  from parlai.core.message import Message
  from parlai.core.teachers import FixedDialogTeacher
  from parlai.utils.io import PathManager
  from .base_agent import _BaseSafetyTeacher
  from .build import build
  import copy
  import json
  import os
  import random
  import sys
label_desc: Use image node_id 9 for calling the WikiToxicCommentsTeacher obj's underlying member method code with example usage: obj._setup_data(datatype) without return types