class_docstr: Base class for MultiLIGHT teacher.
  
  This is an abstract class: do NOT use directly!
class_docstr_tok: ["Base","class","for","MultiLIGHT","teacher",".","This","is","an","abstract","class",":","do","NOT","use","directly","!"]
code: def setup_data(self, datafile: str) -> List[Message]:
      with jsonlines.open(datafile) as reader:
          conversations = [dl for dl in reader]
  
      assert conversations, "No data was loaded by teacher."
  
      for conv in conversations:
          if conv["quality_tier"] not in self.episode_quality_tiers:
              continue
          last_utterance_index = len(conv["messages"]) - 1
  
          first_utterance_timestamp = 0
          characters_index = dict()
          personas = []
          for i, c in enumerate(conv["characters"]):
              personas.append(
                  {"name": c["name"], "persona": c["persona"]}
              )
              characters_index[c["name"]] = i + 1
  
          location = {
              "name": conv["location"]["name"],
              "description": conv["location"]["description"],
          }
  
          context = []
  
          for index, utterance in enumerate(conv["messages"]):
              speaker = utterance["speaker"]
              utterance["speaker_id"] = characters_index[speaker]
              if index == 0:
                  new_episode = True
                  # Setting the start time for the relative timestamps after this.
                  first_utterance_timestamp = utterance["timestamp"]
  
                  if self.use_start_token:
                      context.append(self.start_token)
                  else:
                      # If it is the first utterance,
                      # we just add it to the context for the next round.
                      context.append(
                          self.get_utterance_context(
                              utt=utterance, ts=_format_timestep(0, 0)
                          )
                      )
                      # skip the first utterance after creating the initial context.
                      continue
  
              isConversationDone = index == last_utterance_index
  
              timestamp = utterance["timestamp"]
              timestep = _format_timestep(
                  timestamp, first_utterance_timestamp
              )
  
              yield {
                  "timestep": timestep,
                  "location": location,
                  "personas": personas,
                  "speaker": speaker,
                  "characters": [p["name"] for p in personas],
                  "speaker_id": utterance["speaker_id"],
                  "full_context": context,
                  "speaker_worker_tier": conv["workers_quality_check"][
                      utterance["speaker_id"] - 1
                  ]["worker_tier"],
                  "quality_tier": conv["quality_tier"],
                  "text": None,  # This is an abstract class, we will feel in the text later.
                  "label": self.get_utterance_label(utterance),
              }, new_episode
  
              new_episode = False
              # Generating context for the next round.
              if not isConversationDone:
                  context.append(
                      self.get_utterance_context(
                          utt=utterance, ts=timestep
                      )
                  )
  
imports: from abc import ABC, abstractclassmethod
  import copy
  import jsonlines
  import random
  import os
  from typing import Any, Dict, List, Optional, Set, Tuple
  from parlai.core.message import Message
  from parlai.core.metrics import ExactMatchMetric, F1Metric
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.teachers import DialogTeacher
  from parlai.core.torch_classifier_agent import ConfusionMatrixMetric
  from parlai.utils.data import DatatypeHelper
  from parlai.tasks.light_multiparty.build import build, DATASET_NAME
label_desc: Use image node_id 7 for calling the BaseTeacher obj's underlying member method code with example usage: obj.setup_data(datafile) without return types