class_docstr: MDGender data collected on Mechanical Turk.
class_docstr_tok: ["MDGender","data","collected","on","Mechanical","Turk","."]
code: def _setup_data(self, opt):
      # Load map from image ID to gender
      # TODO: proper train/test/valid splits
      data = []
      convos = self._get_convos(opt)
      for convo in convos:
          class_type = convo["class_type"]
          if self.labels_to_use in ["all", class_type]:
              data.append(convo)
  
      if self.is_train:
          random.shuffle(data)
  
      gend_utils.get_data_stats(data, key="labels")
  
      return data
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.core.teachers import FixedDialogTeacher
  from parlai.tasks.md_gender.build import build
  import parlai.tasks.md_gender.utils
  import json
  import os
  import random
label_desc: Use image node_id 4 for calling the MdGenderTeacher obj's underlying member method code with example usage: obj._setup_data(opt) and returns: data