code: def test_placement_group_status(ray_start_cluster, enable_v2):
      cluster = ray_start_cluster
      cluster.add_node(
          num_cpus=4, _system_config={"enable_autoscaler_v2": enable_v2}
      )
      ray.init(cluster.address)
  
      @ray.remote(num_cpus=1)
      class A:
          def ready(self):
              pass
  
      pg = ray.util.placement_group([{"CPU": 1}])
      ray.get(pg.ready())
  
      # Wait until the usage is updated to the expected, which is
      # when the demand is also updated.
      def is_usage_updated():
          demand_output = get_ray_status_output(cluster.address)
          cpu_usage = demand_output["usage"]
          if cpu_usage == "":
              return False
          cpu_usage = cpu_usage.split("\n")[0]
          expected = "0.0/4.0 CPU (0.0 used of 1.0 reserved in placement groups)"
          if cpu_usage != expected:
              assert cpu_usage == "0.0/4.0 CPU"
              return False
          return True
  
      wait_for_condition(is_usage_updated, AUTOSCALER_UPDATE_INTERVAL_S)
  
      # 2 CPU + 1 PG CPU == 3.0/4.0 CPU (1 used by pg)
      actors = [A.remote() for _ in range(2)]
      actors_in_pg = [
          A.options(
              scheduling_strategy=PlacementGroupSchedulingStrategy(
                  placement_group=pg
              )
          ).remote()
          for _ in range(1)
      ]
  
      ray.get([actor.ready.remote() for actor in actors])
      ray.get([actor.ready.remote() for actor in actors_in_pg])
      # Wait long enough until the usage is propagated to GCS.
      time.sleep(AUTOSCALER_UPDATE_INTERVAL_S)
      demand_output = get_ray_status_output(cluster.address)
      cpu_usage = demand_output["usage"].split("\n")[0]
      expected = (
          "3.0/4.0 CPU (1.0 used of 1.0 reserved in placement groups)"
      )
      assert cpu_usage == expected
  
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 14 for calling a global function with example usage: test_placement_group_status(ray_start_cluster, enable_v2) and returns: True, False, False