code: def test_worker_with_gpu_ids(ray_start_2_cpus_and_gpus):
      num_gpus = 2
      wg = WorkerGroup(num_workers=2, num_gpus_per_worker=1)
      assert len(wg.workers) == 2
      time.sleep(1)
      assert ray_constants.GPU not in ray.available_resources()
      wg.execute(lambda: 1)
      assert len(wg.workers) == 2
      for w in wg.workers:
          resource_ids = w.metadata.resource_ids
          gpu_ids = resource_ids[ray_constants.GPU]
          for gpu_id in gpu_ids:
              assert gpu_id in [str(i) for i in range(num_gpus)]
          assert len(resource_ids[ray_constants.NEURON_CORES]) == 0
  
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 8 for calling a global function with example usage: test_worker_with_gpu_ids(ray_start_2_cpus_and_gpus) without return types