docstr: Last argument is only relevant for the max_turn test.
docstr_tok: ["Last","argument","is","only","relevant","for","the","max_turn","test","."]
code: def _check_metrics_correct(self, script, opt):
      """
      Last argument is only relevant for the max_turn test.
      """
      max_rounds = opt[test_agents.TEST_NUM_ROUNDS_OPT_KEY]
      max_episodes = opt[test_agents.TEST_NUM_EPISODES_OPT_KEY]
      episode_metrics = script.episode_metrics
      for episode_idx, episode in enumerate(episode_metrics):
          goal, episode_metric = episode
          episode_metric = dict_report(episode_metric.report())
          self.assertAlmostEqual(
              episode_metric["all_goals_hit"],
              not test_agents.episode_has_broken_api_turn(
                  episode_idx, max_rounds
              ),
          )
      broken_episodes = sum(
          [
              test_agents.episode_has_broken_api_turn(i, max_rounds)
              for i in range(max_episodes)
          ]
      )
      report = dict_report(script.world.report())
      self.assertAlmostEqual(
          report["all_goals_hit"],
          float(max_episodes - broken_episodes) / max_episodes,
      )
  
imports: import copy
  import unittest
  import parlai.core.tod.tod_test_utils.test_agents
  import parlai.scripts.tod_world_script
  from parlai.core.tod.tod_agents import StandaloneApiAgent
  from parlai.core.tod.world_metrics_handlers import METRICS_HANDLER_CLASSES_TEST_REGISTRY
  from parlai.core.metrics import dict_report
  import projects.tod_simulator.world_metrics.extended_world_metrics
label_desc: Use image node_id 5 for calling the TodWorldInScriptTestBase obj's underlying member method code with example usage: obj._check_metrics_correct(script, opt) without return types