class_docstr: WorldLogger has most of what we need.
  
  We could if-class this logic in it directly, but inheritence + override here is
  neater.
class_docstr_tok: ["WorldLogger","has","most","of","what","we","need",".","We","could","if-class","this","logic","in","it","directly",",","but","inheritence","+","override","here","is","neater","."]
code: def _log_batch(self, world):
      batch_acts = world.get_batch_acts()
      for i, acts in enumerate(batch_acts):
          acts = [
              act
              for act in acts
              if act is not None and "id" in act and "text" in act
          ]
          acts = [
              act
              for act in acts
              if act["id"] != ""
              and (act["text"] != "" or "Human" in act["id"])
          ]
          if len(acts) > 0:
              self._add_msgs(acts, idx=i)
          if world.episode_done():
              self.reset_world(idx=i)
  
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 2 for calling the TodWorldLogger obj's underlying member method code with example usage: obj._log_batch(world) without return types