code: def testNewResources(self):
      sched = ResourceChangingScheduler(
          resources_allocation_function=(
              lambda a, b, c, d: PlacementGroupFactory([{"CPU": 2}])
          )
      )
  
      def train_fn(config):
          ray.train.report(
              dict(
                  metric=1,
                  resources=ray.train.get_context().get_trial_resources(),
              )
          )
  
      analysis = tune.run(
          train_fn,
          scheduler=sched,
          stop={"training_iteration": 2},
          resources_per_trial=PlacementGroupFactory([{"CPU": 1}]),
          num_samples=1,
      )
  
      results_list = list(analysis.results.values())
      assert results_list[0]["resources"].head_cpus == 2.0
  
imports: import json
  import os
  import sys
  import shutil
  import tempfile
  import unittest
  import ray
  from ray.air.constants import TRAINING_ITERATION
  from ray.rllib import _register_all
  import ray.train
  from ray import tune
  from ray.train import Checkpoint, CheckpointConfig
  from ray.tune.logger import NoopLogger
  from ray.tune.execution.placement_groups import PlacementGroupFactory
  from ray.tune.trainable import with_parameters, wrap_function
  from ray.tune.result import DEFAULT_METRIC
  from ray.tune.schedulers import ResourceChangingScheduler
  from ray.train.tests.util import mock_storage_context
label_desc: Use image node_id 6 for calling the FunctionApiTest obj's underlying member method code with example usage: obj.testNewResources() without return types