class_docstr: Cross validation mutator, withhold a fold.
class_docstr_tok: ["Cross","validation","mutator",",","withhold","a","fold","."]
code: def __init__(self, opt: Opt):
      super().__init__(opt)
      self.k_fold = opt["k_fold"]
      self.held_fold = opt["held_fold"]
      assert self.held_fold >= 0, f"held_fold should be greater than 0."
      assert (
          self.held_fold < self.k_fold
      ), f"held_fold should be smaller than {self.k_fold}."
      logging.info(
          f"We are doing {self.k_fold}-fold with {self.held_fold} held from training."
      )
      self.is_training = DatatypeHelper.is_training(opt["datatype"])
      self.fold_cnt = 0
      return
  
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 2 to create a new KFoldWithholdOnTrainMutator object from inherited base classes: ManyEpisodeMutator with example: obj = KFoldWithholdOnTrainMutator(opt)