code: def testWithParameters(self):
      class Data:
          def __init__(self):
              self.data = [0] * 500_000
  
      data = Data()
      data.data[100] = 1
  
      def train_fn(config, data=None):
          data.data[101] = 2  # Changes are local
          ray.train.report(
              dict(metric=len(data.data), hundred=data.data[100])
          )
  
      trial_1, trial_2 = tune.run(
          with_parameters(train_fn, data=data), num_samples=2
      ).trials
  
      self.assertEqual(data.data[101], 0)
      self.assertEqual(trial_1.last_result["metric"], 500_000)
      self.assertEqual(trial_1.last_result["hundred"], 1)
      self.assertEqual(trial_2.last_result["metric"], 500_000)
      self.assertEqual(trial_2.last_result["hundred"], 1)
      self.assertTrue(str(trial_1).startswith("train_"))
  
      # With checkpoint dir parameter
      def train_fn(config, data=None):
          data.data[101] = 2  # Changes are local
          ray.train.report(dict(metric=len(data.data)))
  
      trial_1, trial_2 = tune.run(
          with_parameters(train_fn, data=data), num_samples=2
      ).trials
  
      self.assertEqual(data.data[101], 0)
      self.assertEqual(trial_1.last_result["metric"], 500_000)
      self.assertEqual(trial_2.last_result["metric"], 500_000)
      self.assertTrue(str(trial_1).startswith("train_"))
  
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 4 for calling the FunctionApiTest obj's underlying member method code with example usage: obj.testWithParameters() without return types