code: def test_fractional_gpus(
      ray_start_4_cpus_2_gpus_extra, resource_manager_cls
  ):
      """Test that fractional GPUs lead to more parallelism.
  
      We schedule four trials with 0.75 GPUs each. Since our cluster has 2 GPUs,
      we should be able to run 2 trials in parallel.
  
      Legacy test: test_trial_runner.py::TrialRunnerTest::testFractionalGpus
      """
      snapshot = TrialStatusSnapshot()
      runner = TuneController(
          resource_manager_factory=lambda: resource_manager_cls(),
          callbacks=[TrialStatusSnapshotTaker(snapshot)],
          storage=STORAGE,
      )
      kwargs = {
          "stopping_criterion": {"training_iteration": 1},
          "placement_group_factory": PlacementGroupFactory(
              [{"GPU": 0.75}]
          ),
          "config": {
              "sleep": 1,
          },
          "storage": STORAGE,
      }
      trials = [Trial("__fake", **kwargs) for i in range(4)]
      for t in trials:
          runner.add_trial(t)
  
      while not runner.is_finished():
          runner.step()
  
      assert snapshot.max_running_trials() == 2
      assert snapshot.all_trials_are_terminated()
  
imports: import os
  import time
  from collections import Counter
  import pytest
  import sys
  import ray
  from ray import tune
  from ray.air.execution import FixedResourceManager, PlacementGroupResourceManager
  from ray.tune import PlacementGroupFactory, TuneError
  from ray.tune.execution.tune_controller import TuneController
  from ray.tune.experiment import Trial
  from ray.tune.schedulers import FIFOScheduler, TrialScheduler
  from ray.tune.search import BasicVariantGenerator
  from ray.tune.utils.mock import TrialStatusSnapshot, TrialStatusSnapshotTaker
  from ray.train.tests.util import mock_storage_context
label_desc: Use image node_id 3 for calling a global function with example usage: test_fractional_gpus(ray_start_4_cpus_2_gpus_extra, resource_manager_cls) without return types