code: def evaluate_world_model(
      agent_type,
      loop_hparams,
      planner_hparams,
      model_dir,
      policy_dir,
      random_starts_step_limit,
      debug_video_path,
      log_every_steps,
  ):
      """Evaluates the world model."""
      if debug_video_path:
          debug_video_path = os.path.join(debug_video_path, "0.avi")
  
      storage_env = rl_utils.setup_env(
          loop_hparams, batch_size=1, max_num_noops=0
      )
      stacked_env = rl_utils.BatchStackWrapper(
          storage_env, loop_hparams.frame_stack_size
      )
      policy_hparams = trainer_lib.create_hparams(
          loop_hparams.base_algo_params
      )
      agent = make_agent_from_hparams(
          agent_type,
          storage_env,
          stacked_env,
          loop_hparams,
          policy_hparams,
          planner_hparams,
          model_dir,
          policy_dir,
          # TODO(koz4k): Loop over eval_sampling_temps?
          sampling_temp=loop_hparams.eval_sampling_temps[0],
      )
      collect_frames_for_random_starts(
          storage_env,
          stacked_env,
          agent,
          loop_hparams.frame_stack_size,
          random_starts_step_limit,
          log_every_steps,
      )
      return rl_utils.evaluate_world_model(
          storage_env,
          loop_hparams,
          model_dir,
          debug_video_path,
          split=None,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import datetime
  import os
  from tensor2tensor.data_generators import gym_env
  from tensor2tensor.layers import common_video
  from tensor2tensor.models.research import rl
  from tensor2tensor.rl import rl_utils
  from tensor2tensor.rl import trainer_model_based_params
  from tensor2tensor.utils import flags
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import trainer_lib
  import tensorflow.compat.v1
label_desc: Use image node_id 19 for calling a global function with example usage: evaluate_world_model(agent_type, loop_hparams, planner_hparams, model_dir, policy_dir, random_starts_step_limit, debug_video_path, log_every_steps) and returns: rl_utils