code: def test_logging_to_driver(shutdown_only):
      ray.init(num_cpus=1, log_to_driver=True)
  
      @ray.remote
      def f():
          # It's important to make sure that these print statements occur even
          # without calling sys.stdout.flush() and sys.stderr.flush().
          for i in range(10):
              print(i, end=" ")
              print(100 + i, end=" ", file=sys.stderr)
  
      captured = {}
      with CaptureOutputAndError(captured):
          ray.get(f.remote())
          time.sleep(1)
  
      out_lines = captured["out"]
      err_lines = captured["err"]
      for i in range(10):
          assert str(i) in out_lines
  
      for i in range(100, 110):
          assert str(i) in err_lines
  
imports: import logging
  import os
  import pickle
  import socket
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.utils
  import ray.cluster_utils
  import ray.util.accelerators
  from ray._private.test_utils import check_call_ray, wait_for_num_actors
  import setproctitle
label_desc: Use image node_id 2 for calling a global function with example usage: test_logging_to_driver(shutdown_only) without return types