class_docstr: Shuffles all the turns in a conversation.
  
  Labels remain in the original ordering, but the order of text (prompts) is mixed up.
  Thus "one half" of the conversation is reordered.
class_docstr_tok: ["Shuffles","all","the","turns","in","a","conversation",".","Labels","remain","in","the","original","ordering",",","but","the","order","of","text","(","prompts",")","is","mixed","up",".","Thus","``","one","half","''","of","the","conversation","is","reordered","."]
code: def episode_mutation(self, episode: List[Message]) -> List[Message]:
      texts = []
      for turn in episode:
          texts.append(turn.pop("text"))
      if self.opt.get("preserve_context"):
          first_turn = texts[0].split("\n")
          context, text = first_turn[:-1], first_turn[-1]
          texts[0] = text
      else:
          context = []
      self.rng.shuffle(texts)
      for i, turn in enumerate(episode):
          text = texts.pop(0)
          if i == 0 and self.opt.get("preserve_context") and context:
              text = "\n".join(context + [text])
          turn["text"] = text
      return episode
  
file_path: ParlAI/parlai/mutators/episode_shuffle.py
imports: import random
  from typing import List, Optional
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.core.mutators import register_mutator, EpisodeMutator
  from parlai.core.params import ParlaiParser
label_desc: Use image node_id 3 for calling the EpisodeShuffleMutator obj's underlying member method code with example usage: obj.episode_mutation(episode) and returns: episode