code: def test_agent_logs_not_streamed_to_drivers():
      """Ensure when the job submission is used,
      (ray.init is called from an agent), the agent logs are
      not streamed to drivers.
  
      Related: https://github.com/ray-project/ray/issues/29944
      """
      script = """
  import ray
  from ray.job_submission import JobSubmissionClient, JobStatus
  from ray._private.test_utils import format_web_url
  from ray._private.test_utils import wait_for_condition
  
  ray.init()
  address = ray._private.worker._global_node.webui_url
  address = format_web_url(address)
  client = JobSubmissionClient(address)
  submission_id = client.submit_job(entrypoint="ls")
  wait_for_condition(
      lambda: client.get_job_status(submission_id) == JobStatus.SUCCEEDED
  )
      """
  
      proc = run_string_as_driver_nonblocking(script)
      out_str = proc.stdout.read().decode("ascii")
      err_str = proc.stderr.read().decode("ascii")
  
      print(out_str, err_str)
  
      assert "(raylet)" not in out_str
      assert "(raylet)" not in err_str
  
imports: import logging
  import os
  import ray
  import requests
  import shutil
  import sys
  import tempfile
  import time
  from pathlib import Path
  from functools import partial
  import pytest
  import yaml
  from ray._private.utils import get_or_create_event_loop
  from ray._private.runtime_env.working_dir import upload_working_dir_if_needed
  from ray._private.runtime_env.py_modules import upload_py_modules_if_needed
  from ray._private.ray_constants import DEFAULT_DASHBOARD_AGENT_LISTEN_PORT
  from ray._private.test_utils import chdir, format_web_url, wait_until_server_available, wait_for_condition, run_string_as_driver_nonblocking, get_current_unused_port, async_wait_for_condition_async_predicate
  from ray.dashboard.modules.job.common import JobSubmitRequest, validate_request_type, JOB_ACTOR_NAME_TEMPLATE, SUPERVISOR_ACTOR_RAY_NAMESPACE
  from ray.dashboard.tests.conftest import *
  from ray.runtime_env.runtime_env import RuntimeEnv, RuntimeEnvConfig
  from ray.util.state import get_node, list_nodes, list_actors
  from ray.job_submission import JobStatus, JobSubmissionClient
  from ray.tests.conftest import _ray_start
  from ray.dashboard.modules.job.job_head import JobAgentSubmissionClient
label_desc: Use image node_id 6 for calling a global function with example usage: test_agent_logs_not_streamed_to_drivers() without return types