code: def load_eval_worlds(agent, opt, datatype):
      """
      Create a new eval world for the agent and the given opt.
  
      Overrides the datatype options for doing this.  Handles some magic
      overrides of other special options for the training script.
  
      :param Agent agent:
          The model being trained.
  
      :param Opt opt:
          The global CLI opts.
  
      :param string datatype:
          The new datatype.
      """
  
      if "stream" in opt["datatype"]:
          datatype += ":stream"
      opt = opt.copy()
      opt["datatype"] = datatype
      if opt.get("evaltask"):
          # if a different eval task is specified, use it.
          opt["task"] = opt["evaltask"]
      if opt.get("eval_batchsize"):
          # override eval time batchsize
          opt["batchsize"] = opt["eval_batchsize"]
      if opt.get("eval_dynamic_batching"):
          # FIXME: see issue tracked in https://github.com/facebookresearch/ParlAI/issues/3367
          # override eval time dynamic batching settings
          eval_dyn_batch = (
              None
              if opt["eval_dynamic_batching"] == "off"
              else opt["eval_dynamic_batching"]
          )
          opt["dynamic_batching"] = eval_dyn_batch
  
      tasks = opt["task"].split(",")
      worlds = []
      # possibly load agent
      if opt.get("validation_share_agent", False):
          valid_agent = create_agent_from_shared(agent.share())
      else:
          valid_agent = agent
      # create worlds
      for task in tasks:
          task_opt = opt.copy()  # copy opt since we edit the task
          task_opt["task"] = task
          valid_world = create_task(task_opt, valid_agent)
          worlds.append(valid_world)
  
      return worlds
  
imports: import copy
  import random
  import torch
  import json
  import os
  import signal
  from typing import Tuple
  import numpy
  import parlai.utils.logging
  from parlai.core.agents import create_agent, create_agent_from_shared
  from parlai.core.exceptions import StopTrainException
  from parlai.core.logs import TensorboardLogger, WandbLogger, ClearMLLogger
  from parlai.core.metrics import Metric
  from parlai.core.metrics import aggregate_named_reports, aggregate_unnamed_reports, dict_report
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser, print_announcements
  from parlai.core.script import ParlaiScript, register_script
  from parlai.core.worlds import create_task, World
  from parlai.scripts.build_dict import build_dict, setup_args
  from parlai.scripts.eval_model import get_task_world_logs
  from parlai.utils.distributed import sync_object, is_primary_worker, all_gather_list, is_distributed, get_rank, num_workers
  from parlai.utils.io import PathManager
  from parlai.utils.misc import Timer, nice_report
  from parlai.utils.world_logging import WorldLogger
label_desc: Use image node_id 4 for calling a global function with example usage: load_eval_worlds(agent, opt, datatype) and returns: worlds