code: def test_get_all_live_placement_group_names(ray_instance):
      """Test the logic to parse the Ray placement group table.
  
      The test contains three cases:
      - A named placement group that was created and is still alive ("pg2").
      - A named placement group that's still being scheduled ("pg3").
      - An unnamed placement group.
  
      Only "pg2" and "pg3" should be returned as live placement group names.
      """
  
      # Named placement group that's been removed (should not be returned).
      pg1 = ray.util.placement_group([{"CPU": 0.1}], name="pg1")
      ray.util.remove_placement_group(pg1)
  
      # Named, detached placement group that's been removed (should not be returned).
      pg2 = ray.util.placement_group(
          [{"CPU": 0.1}], name="pg2", lifetime="detached"
      )
      ray.util.remove_placement_group(pg2)
  
      # Named placement group that's still alive (should be returned).
      pg3 = ray.util.placement_group([{"CPU": 0.1}], name="pg3")
      assert pg3.wait()
  
      # Named, detached placement group that's still alive (should be returned).
      pg4 = ray.util.placement_group(
          [{"CPU": 0.1}], name="pg4", lifetime="detached"
      )
      assert pg4.wait()
  
      # Named placement group that's being scheduled (should be returned).
      pg5 = ray.util.placement_group([{"CPU": 1000}], name="pg5")
      assert not pg5.wait(timeout_seconds=0.001)
  
      # Named, detached placement group that's being scheduled (should be returned).
      pg6 = ray.util.placement_group(
          [{"CPU": 1000}], name="pg6", lifetime="detached"
      )
      assert not pg6.wait(timeout_seconds=0.001)
  
      # Unnamed placement group (should not be returned).
      pg7 = ray.util.placement_group([{"CPU": 0.1}])
      assert pg7.wait()
  
      # Unnamed, detached placement group (should not be returned).
      pg8 = ray.util.placement_group(
          [{"CPU": 0.1}], lifetime="detached"
      )
      assert pg8.wait()
  
      assert set(get_all_live_placement_group_names()) == {
          "pg3",
          "pg4",
          "pg5",
          "pg6",
      }
  
imports: import asyncio
  import json
  import os
  import time
  from unittest.mock import patch
  import numpy
  import pytest
  from fastapi.encoders import jsonable_encoder
  import ray
  from ray import serve
  from ray._private.resource_spec import HEAD_NODE_RESOURCE_NAME
  from ray._private.test_utils import wait_for_condition
  from ray.serve._private.test_utils import MockTimer
  from ray.serve._private.utils import MetricsPusher, calculate_remaining_timeout, get_all_live_placement_group_names, get_current_actor_id, get_head_node_id, is_running_in_asyncio_loop, merge_dict, msgpack_deserialize, msgpack_serialize, override_runtime_envs_except_env_vars, serve_encoders, snake_to_camel_case
  from ray.serve.tests.common.remote_uris import TEST_DAG_PINNED_URI, TEST_DEPLOY_GROUP_PINNED_URI
label_desc: Use image node_id 10 for calling a global function with example usage: test_get_all_live_placement_group_names(ray_instance) without return types