class_docstr: Cross validation mutator, withhold a fold.
class_docstr_tok: ["Cross","validation","mutator",",","withhold","a","fold","."]
code: def many_episode_mutation(
      self, episode: List[Message]
  ) -> List[List[Message]]:
      # assuming single message episode
      assert (
          len(episode) == 1
      ), "k_fold mutator only works with single message episode."
      if not self.is_training:
          return [episode]
      message = episode[0]
      text = message["text"]
      fold = (
          hashlib.sha256(text.encode("utf8")).digest()[0] % self.k_fold
      )
      if fold == self.held_fold:
          self.fold_cnt += 1
          return []
      return [episode]
  
file_path: ParlAI/projects/trollhunting/mutators/k_fold.py
imports: from typing import List, Optional
  from parlai.core.message import Message
  from parlai.core.mutators import ManyEpisodeMutator, register_mutator
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.utils.data import DatatypeHelper
  import hashlib
  import parlai.utils.logging
label_desc: Use image node_id 3 for calling the KFoldWithholdOnTrainMutator obj's underlying member method code with example usage: obj.many_episode_mutation(episode) and returns: list, list, list