code: def test_destroy_group(ray_start_distributed_multigpu_2_nodes_4_gpus):
      world_size = 2
      actors, _ = create_collective_multigpu_workers(world_size)
      # Now destroy the group at actor0
      ray.wait([actors[0].destroy_group.remote()])
      actor0_is_init = ray.get(
          actors[0].report_is_group_initialized.remote()
      )
      assert not actor0_is_init
  
      # should go well as the group `random` does not exist at all
      ray.wait([actors[0].destroy_group.remote("random")])
  
      actor1_is_init = ray.get(
          actors[1].report_is_group_initialized.remote()
      )
      assert actor1_is_init
      ray.wait([actors[1].destroy_group.remote("random")])
      actor1_is_init = ray.get(
          actors[1].report_is_group_initialized.remote()
      )
      assert actor1_is_init
      ray.wait([actors[1].destroy_group.remote("default")])
      actor1_is_init = ray.get(
          actors[1].report_is_group_initialized.remote()
      )
      assert not actor1_is_init
  
      # Now reconstruct the group using the same name
      init_results = ray.get(
          [
              actor.init_group.remote(world_size, i)
              for i, actor in enumerate(actors)
          ]
      )
      for i in range(world_size):
          assert init_results[i]
      actor0_is_init = ray.get(
          actors[0].report_is_group_initialized.remote()
      )
      assert actor0_is_init
      actor1_is_init = ray.get(
          actors[0].report_is_group_initialized.remote()
      )
      assert actor1_is_init
  
file_path: ray/python/ray/util/collective/tests/distributed_multigpu_tests/test_distributed_multigpu_basic_apis.py
imports: import pytest
  import ray
  from random import shuffle
  from ray.util.collective.tests.util import create_collective_multigpu_workers
label_desc: Use image node_id 5 for calling a global function with example usage: test_destroy_group(ray_start_distributed_multigpu_2_nodes_4_gpus) without return types