class_docstr: DirectorLeftToRightMutator prepares data for training left to right (LTR) classifier
  for Director model.
  
  This limits to context to all but last utterance that is fed to the encoder.
  The final utterance is considered as a label for the decoder and the attribute/classifier
  labels are stored seperately marking the final utterance pos. or neg.
  
  This mutator also adds a is_ltr flag to differentiate classifier exs from the generator exs which are used to finetune the generator model.
class_docstr_tok: ["DirectorLeftToRightMutator","prepares","data","for","training","left","to","right","(","LTR",")","classifier","for","Director","model",".","This","limits","to","context","to","all","but","last","utterance","that","is","fed","to","the","encoder",".","The","final","utterance","is","considered","as","a","label","for","the","decoder","and","the","attribute\/classifier","labels","are","stored","seperately","marking","the","final","utterance","pos",".","or","neg",".","This","mutator","also","adds","a","is_ltr","flag","to","differentiate","classifier","exs","from","the","generator","exs","which","are","used","to","finetune","the","generator","model","."]
code: def many_episode_mutation(
      self, episode: List[Message]
  ) -> List[List[Message]]:
      new_episodes = []
      for message in episode:
          text = message["text"]
          utterances = text.split("\n")
  
          if len(utterances) < 2:
              continue
  
          new_message = copy.deepcopy(message)
          new_message.force_set("is_ltr", True)
          if message["labels"][0] == "pos":
              new_message.force_set("classifier_label", "pos")
          else:
              new_message.force_set("classifier_label", "neg")
          new_message.force_set("text", "\n".join(utterances[:-1]))
          new_message.force_set("labels", [utterances[-1]])
          new_episodes.append([new_message])
      return new_episodes
  
imports: from string import punctuation
  import copy
  from typing import List
  from parlai.core.mutators import register_mutator, ManyEpisodeMutator, MessageMutator
  from parlai.core.message import Message
  from parlai.mutators.flatten import FlattenMutator
  from parlai.utils.strings import normalize_reply
  from parlai.tasks.wizard_of_wikipedia.agents import TOKEN_KNOWLEDGE, TOKEN_END_KNOWLEDGE
  from parlai.tasks.wizard_of_internet import constants
  from .constants import FeedbackType, UNWANTED_TOKENS
label_desc: Use image node_id 1 for calling the DirectorLeftToRightMutator obj's underlying member method code with example usage: obj.many_episode_mutation(episode) and returns: new_episodes