class_docstr: Generates a controllable_gen version of a ParlAI task, i.e., for tasks with multi-
  turn dialogues (episodes), this will generate a task with single example episodes,
  in which we append to the context a special classification token.
class_docstr_tok: ["Generates","a","controllable_gen","version","of","a","ParlAI","task",",","i.e.",",","for","tasks","with","multi-","turn","dialogues","(","episodes",")",",","this","will","generate","a","task","with","single","example","episodes",",","in","which","we","append","to","the","context","a","special","classification","token","."]
docstr: Attempt to load pre-build data.
  
  Checks for the most recently build data via the date string.
  
  :param opt:
      options dict
  :param filename:
      name of (potentially) saved data
  
  :return episodes:
      return list of episodes, if available
docstr_tok: ["Attempt","to","load","pre-build","data",".","Checks","for","the","most","recently","build","data","via","the","date","string",".",":","param","opt",":","options","dict",":","param","filename",":","name","of","(","potentially",")","saved","data",":","return","episodes",":","return","list","of","episodes",",","if","available"]
code: def load_data(
      self, opt: Opt, filename: str
  ) -> Optional[List[List[Message]]]:
      """
      Attempt to load pre-build data.
  
      Checks for the most recently build data via the date string.
  
      :param opt:
          options dict
      :param filename:
          name of (potentially) saved data
  
      :return episodes:
          return list of episodes, if available
      """
      # first check for the most recent date
      save_dir = self._get_save_path(opt["datapath"], "*")
      all_dates = []
      for fname in glob.glob(os.path.join(save_dir, filename)):
          date = os.path.split(fname)[0].split("_")[-1]
          all_dates.append(date)
  
      if len(all_dates) > 0:
          most_recent = os.path.join(
              self._get_save_path(
                  opt["datapath"], sorted(all_dates)[-1]
              ),
              filename,
          )
      else:
          # data has not been built yet
          return None
  
      if opt["invalidate_cache"]:
          # invalidate the cache and remove the existing data
          logging.warning(
              f" [ WARNING: invalidating cache at {self.save_path} and rebuilding the data. ]"
          )
          if self.save_path == most_recent:
              os.remove(self.save_path)
          return None
  
      # Loading from most recent date
      self.save_path = most_recent
      logging.info(
          f" [ Data already exists. Loading from: {self.save_path} ]"
      )
      with PathManager.open(self.save_path, "rb") as f:
          data = json.load(f)
  
      return data
  
imports: from parlai.core.params import ParlaiParser
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.teachers import FixedDialogTeacher
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  from parlai.utils.typing import TShared
  from parlai.tasks.genderation_bias.build import build
  from parlai.tasks.genderation_bias.utils import flatten_and_classify, get_original_task_module
  from copy import deepcopy
  import datetime
  import glob
  import json
  import os
  from tqdm import tqdm
  from typing import List, Optional, Tuple
label_desc: Use image node_id 8 for calling the ControllableTaskTeacher obj's underlying member method code with example usage: obj.load_data(opt, filename) and returns: data, None, None