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_correctness_from_script_logs(
      self, script, opt, process_round_utts=lambda x: x
  ):
      """
      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]
      # there's something funky with logger.get_log() that inserts a space, but not gonna worry about it for now
      logs = [x for x in script.logger.get_logs() if len(x) > 0]
      for episode_idx in range(max_episodes):
          episode_from_world = logs[episode_idx]
          # first round is context
          context = episode_from_world[0]
          self.assertEquals(
              context[0]["text"],
              "APIS: "
              + tod_core.SerializationHelpers.list_of_maps_to_str(
                  test_agents.make_api_schemas_machine(max_rounds)
              ),
          )
          self.assertEquals(
              context[3]["text"],
              "GOAL: "
              + tod_core.SerializationHelpers.list_of_maps_to_str(
                  test_agents.make_goal_calls_machine(max_rounds)
              ),
          )
          # Check the rest
          world_utts = [
              [x["text"] for x in turn]
              for turn in episode_from_world[1:]
          ]
          # ... ignore the last DONE turn here cause it's not that important
  
          self.assertEquals(
              world_utts[:-1],
              process_round_utts(
                  test_agents.get_round_utts(episode_idx, max_rounds)[
                      :-1
                  ]
              ),
          )
  
imports: import copy
  import unittest
  import parlai.core.tod.tod_test_utils.test_agents
  import parlai.core.tod.tod_core
  import parlai.scripts.tod_world_script
  from parlai.core.tod.tod_agents import StandaloneApiAgent
label_desc: Use image node_id 4 for calling the TodWorldInScriptTestBase obj's underlying member method code with example usage: obj._check_correctness_from_script_logs(script, opt, process_round_utts) without return types