code: def get_task_world_logs(task, world_logs, is_multitask=False):
      if not is_multitask:
          return world_logs
      else:
          base_outfile, extension = os.path.splitext(world_logs)
          return f"{base_outfile}_{task}{extension}"
  
imports: from parlai.core.params import ParlaiParser, print_announcements
  from parlai.core.agents import create_agent
  from parlai.core.logs import TensorboardLogger
  from parlai.core.metrics import aggregate_named_reports, aggregate_unnamed_reports, Metric
  from parlai.core.opt import Opt
  from parlai.core.worlds import create_task
  from parlai.utils.misc import TimeLogger, nice_report
  from parlai.utils.world_logging import WorldLogger
  from parlai.core.script import ParlaiScript, register_script
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  import json
  import os
  import random
  from parlai.utils.distributed import is_primary_worker, all_gather_list, is_distributed, get_rank
label_desc: Use image node_id 3 for calling a global function with example usage: get_task_world_logs(task, world_logs, is_multitask) and returns: world_logs, base_outfile, str, task, extension