code: def test_placement_group_parent(
      ray_4_node_4_cpu, placement_group_capture_child_tasks
  ):
      """Tests that parent placement group will be used."""
      num_workers = 2
      bundle = {"CPU": 1}
      bundles = [bundle.copy() for _ in range(num_workers + 1)]
      placement_group = ray.util.placement_group(bundles)
  
      def train_func():
          return get_current_placement_group().id
  
      @ray.remote
      def test():
          config = TestConfig()
          e = BackendExecutor(config, num_workers=2)
          e.start()
          _start_training(e, train_func)
          return e.finish_training()
  
      results_future = test.options(
          scheduling_strategy=PlacementGroupSchedulingStrategy(
              placement_group=placement_group,
              placement_group_capture_child_tasks=placement_group_capture_child_tasks,
          ),
      ).remote()
      results = ray.get(results_future)
      for worker_result in results:
          if placement_group_capture_child_tasks:
              assert worker_result == placement_group.id
          else:
              assert worker_result != placement_group.id
  
imports: import math
  import os
  import tempfile
  import time
  from unittest.mock import patch
  import pytest
  import ray
  import ray._private.ray_constants
  from ray import train
  from ray.air._internal.util import StartTraceback
  from ray.tests.conftest import pytest_runtest_makereport
  from ray.train import DataConfig
  from ray.train._internal.backend_executor import BackendExecutor, InactiveWorkerGroupError, TrainBackendError, TrainingWorkerError
  from ray.train._internal.storage import StorageContext
  from ray.train._internal.worker_group import WorkerGroup, WorkerMetadata
  from ray.train.backend import Backend, BackendConfig
  from ray.train.constants import ENABLE_SHARE_CUDA_VISIBLE_DEVICES_ENV, ENABLE_SHARE_NEURON_CORES_ACCELERATOR_ENV, TRAIN_ENABLE_WORKER_SPREAD_ENV
  from ray.train.tensorflow import TensorflowConfig
  from ray.train.torch import TorchConfig
  from ray.util.placement_group import get_current_placement_group
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 25 for calling a global function with example usage: test_placement_group_parent(ray_4_node_4_cpu, placement_group_capture_child_tasks) and returns: get_current_placement_group, e