code: def test_task_logs_info_basic(shutdown_only):
      """Test tasks (normal tasks/actor tasks) execution logging
      to files have the correct task log info
      """
      ray.init(num_cpus=1)
  
      def do_print(x):
          out_msg = ""
          err_msg = ""
          for j in range(3):
              out_msg += f"this is log line {j} to stdout from {x}\n"
          print(out_msg, end="", file=sys.stdout)
  
          for j in range(3):
              err_msg += f"this is log line {j} to stderr from {x}\n"
          print(err_msg, end="", file=sys.stderr)
          return out_msg, err_msg
  
      @ray.remote
      class Actor:
          def print(self, x):
              return do_print(x)
  
      @ray.remote
      def task_print(x):
          return do_print(x)
  
      a = Actor.remote()
      expected_logs = {}
      for j in range(3):
          exp_actor_out, exp_actor_err = ray.get(
              a.print.options(name=f"actor-task-{j}").remote(
                  f"actor-task-{j}"
              )
          )
          expected_logs[f"actor-task-{j}-out"] = exp_actor_out
          expected_logs[f"actor-task-{j}-err"] = exp_actor_err
  
      for j in range(3):
          exp_task_out, exp_task_err = ray.get(
              task_print.options(name=f"normal-task-{j}").remote(
                  f"normal-task-{j}"
              )
          )
          expected_logs[f"normal-task-{j}-out"] = exp_task_out
          expected_logs[f"normal-task-{j}-err"] = exp_task_err
  
      def verify():
          # verify logs
          for j in range(3):
              check_file(
                  "out",
                  f"normal-task-{j}",
                  expected_logs[f"normal-task-{j}-out"],
              )
              check_file(
                  "err",
                  f"normal-task-{j}",
                  expected_logs[f"normal-task-{j}-err"],
              )
              check_file(
                  "out",
                  f"actor-task-{j}",
                  expected_logs[f"actor-task-{j}-out"],
              )
              check_file(
                  "err",
                  f"actor-task-{j}",
                  expected_logs[f"actor-task-{j}-err"],
              )
              return True
  
      wait_for_condition(verify)
  
imports: import asyncio
  from collections import defaultdict
  import os
  from typing import Dict
  import pytest
  import sys
  import time
  from ray._private import ray_constants
  from functools import reduce
  import ray
  from ray._private.state_api_test_utils import PidActor, get_state_api_manager, verify_tasks_running_or_terminated, verify_failed_task
  from ray.util.state.common import ListApiOptions, StateResource
  from ray._private.test_utils import async_wait_for_condition_async_predicate, run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition
  from ray.util.state import StateApiClient, list_actors, list_jobs, list_tasks
label_desc: Use image node_id 16 for calling a global function with example usage: test_task_logs_info_basic(shutdown_only) and returns: out_msg,  err_msg, do_print, do_print, True