code: def test_save_load_checkpoint_path_fn(ray_start_2_cpus, tmp_path):
      """Assert that restoring from a Trainable.save() future works with
      function trainables.
  
      Needs Ray cluster so we get actual futures.
      """
      trainable_cls = wrap_function(function_trainable)
      trainable = ray.remote(trainable_cls).remote(
          storage=StorageContext(
              storage_path=str(tmp_path),
              experiment_dir_name="exp",
              trial_dir_name="trial",
          )
      )
      ray.get(trainable.train.remote())
  
      saving_future = trainable.save.remote()
  
      # Check for errors
      ray.get(saving_future)
  
      restoring_future = trainable.restore.remote(saving_future)
  
      ray.get(restoring_future)
  
imports: import json
  import os
  from typing import Dict, Union
  import pytest
  import ray
  from ray import train, tune
  from ray.train._internal.storage import StorageContext
  from ray.tune.trainable import wrap_function
  from ray.train.tests.util import create_dict_checkpoint
label_desc: Use image node_id 4 for calling a global function with example usage: test_save_load_checkpoint_path_fn(ray_start_2_cpus, tmp_path) without return types