class_docstr: Generates contexts shown to crowdsourced workers during data collection.
class_docstr_tok: ["Generates","contexts","shown","to","crowdsourced","workers","during","data","collection","."]
docstr: Initalize the context generator.
docstr_tok: ["Initalize","the","context","generator","."]
code: def __init__(self, opt, datatype: str = "test", seed: int = None):
      """
      Initalize the context generator.
      """
      if seed is not None:
          self.rng = random.Random(seed)
      else:
          self.rng = random.Random()
  
imports: import json
  import os
  import numpy
  import random
  import time
  from parlai.core.message import Message
  from parlai.core.worlds import validate
  import parlai.utils.logging
  from parlai.crowdsourcing.tasks.model_chat.utils import Compatibility
  from parlai.crowdsourcing.tasks.model_chat.worlds import get_bot_worker, ModelChatWorld, ModelChatOnboardWorld
label_desc: Use image node_id 1 to create a new ContextGenerator object  with example: obj = ContextGenerator(opt, datatype, seed)