code: def init_contexts(self, shared=None):
      self.contexts_data = get_contexts_data(self.opt, shared=shared)
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import json
  import random
  from parlai.tasks.blended_skill_talk.agents import raw_data_path, safe_personas_path
  from parlai.tasks.interactive.worlds import InteractiveWorld
  from parlai.tasks.self_chat.worlds import SelfChatWorld
  from parlai.utils.io import PathManager
label_desc: Use image node_id 2 for calling the SelfChatWorld obj's underlying member method code with example usage: obj.init_contexts(shared) without return types