code: def test_worker_creation(ray_start_2_cpus):
      assert ray.available_resources()["CPU"] == 2
      wg = WorkerGroup(num_workers=2)
      assert len(wg.workers) == 2
      time.sleep(1)
      # Make sure both CPUs are being used by the actors.
      assert "CPU" not in ray.available_resources()
      wg.shutdown()
  
imports: import time
  from collections import defaultdict
  import pytest
  import ray
  import ray._private.ray_constants
  from ray.train._internal.worker_group import Worker, WorkerGroup, WorkerMetadata
label_desc: Use image node_id 4 for calling a global function with example usage: test_worker_creation(ray_start_2_cpus) without return types