code: def test_placement_group_wait_api(
      ray_start_cluster_head_with_external_redis,
  ):
      cluster = ray_start_cluster_head_with_external_redis
      cluster.add_node(num_cpus=2)
      cluster.add_node(num_cpus=2)
      cluster.wait_for_nodes()
  
      # Create placement group 1 successfully.
      placement_group1 = ray.util.placement_group(
          [{"CPU": 1}, {"CPU": 1}]
      )
      assert placement_group1.wait(10)
  
      # Restart gcs server.
      cluster.head_node.kill_gcs_server()
      cluster.head_node.start_gcs_server()
  
      # Create placement group 2 successfully.
      placement_group2 = ray.util.placement_group(
          [{"CPU": 1}, {"CPU": 1}]
      )
      assert placement_group2.wait(10)
  
      # Remove placement group 1.
      ray.util.remove_placement_group(placement_group1)
  
      # Wait for placement group 1 after it is removed.
      with pytest.raises(Exception):
          placement_group1.wait(10)
  
imports: import sys
  import time
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray.cluster_utils
  import ray.experimental.internal_kv
  from ray._private.ray_constants import DEBUG_AUTOSCALING_ERROR, DEBUG_AUTOSCALING_STATUS
  from ray.autoscaler._private.constants import AUTOSCALER_UPDATE_INTERVAL_S
  from ray._private.test_utils import convert_actor_state, generate_system_config_map, is_placement_group_removed, kill_actor_and_wait_for_failure, reset_autoscaler_v2_enabled_cache, run_string_as_driver, wait_for_condition
  from ray.autoscaler._private.commands import debug_status
  from ray.exceptions import RaySystemError
  from ray.util.client.ray_client_helpers import connect_to_client_or_not
  from ray.util.placement_group import placement_group, remove_placement_group
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 3 for calling a global function with example usage: test_placement_group_wait_api(ray_start_cluster_head_with_external_redis) without return types