code: def _run_episode(self, opt, world, world_logger):
      while not world.episode_done():
          world.parley()
          world_logger.log(world)
  
          if opt["display_examples"]:
              logging.info(world.display())
  
      if opt["display_examples"]:
          logging.info("-- end of episode --")
  
      world.reset()
      world_logger.reset_world()  # flush this episode
      return zip(
          world.get_last_batch_goals(),
          world.get_last_batch_episode_metrics(),
      )
  
imports: import json
  from copy import deepcopy
  from shutil import copyfile
  import os
  import parlai.utils.logging
  import parlai.core.tod.tod_world
  import parlai.core.tod.tod_agents
  from parlai.core.agents import create_agent
  from parlai.core.metrics import dict_report, aggregate_unnamed_reports
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.script import ParlaiScript, register_script
  from parlai.utils.distributed import is_primary_worker, all_gather_list, is_distributed, get_rank, sync_object, num_workers
  from parlai.utils.io import PathManager
  from parlai.utils.misc import TimeLogger, nice_report
  from parlai.utils.world_logging import WorldLogger
label_desc: Use image node_id 7 for calling the TodWorldScript obj's underlying member method code with example usage: obj._run_episode(opt, world, world_logger) and returns: zip