code: def test_dedup_error_warning_logs(ray_start_cluster, monkeypatch):
      with monkeypatch.context() as m:
          m.setenv("RAY_DEDUP_LOGS_AGG_WINDOW_S", 5)
          cluster = ray_start_cluster
          cluster.add_node(num_cpus=1)
          cluster.add_node(num_cpus=1)
          cluster.add_node(num_cpus=1)
  
          script = """
  import ray
  import time
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
  
  ray.init()
  
  @ray.remote(num_cpus=0)
  class Foo:
      def __init__(self):
          time.sleep(1)
  
  # NOTE: We should save actor, otherwise it will be out of scope.
  actors = [Foo.remote() for _ in range(30)]
  ray.get([a.__ray_ready__.remote() for a in actors])
  """
          out_str = run_string_as_driver(script)
          print(out_str)
      assert "PYTHON worker processes have been started" in out_str
      assert out_str.count("RAY_DEDUP_LOGS") == 1
      assert "[repeated" in out_str
  
imports: import os
  import re
  import signal
  import subprocess
  import sys
  import time
  import pytest
  import ray
  from ray._private.test_utils import run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition
label_desc: Use image node_id 2 for calling a global function with example usage: test_dedup_error_warning_logs(ray_start_cluster, monkeypatch) without return types