code: def test_decorator_with_spot_instances_save_and_load_checkpoints(
      sagemaker_session,
      dummy_container_without_error,
      cpu_instance_type,
      checkpoint_s3_location,
  ):
      @remote(
          role=ROLE,
          image_uri=dummy_container_without_error,
          instance_type=cpu_instance_type,
          sagemaker_session=sagemaker_session,
          use_spot_instances=True,
          max_wait_time_in_seconds=48 * 60 * 60,
      )
      def save_checkpoints(checkpoint_path: Union[str, os.PathLike]):
          file_path_1 = os.path.join(
              checkpoint_path, "checkpoint_1.json"
          )
          with open(file_path_1, "w") as f:
              f.write(CHECKPOINT_FILE_CONTENT)
  
          file_path_2 = os.path.join(
              checkpoint_path, "checkpoint_2.json"
          )
          with open(file_path_2, "w") as f:
              f.write(CHECKPOINT_FILE_CONTENT)
  
          return CHECKPOINT_FILE_CONTENT
  
      @remote(
          role=ROLE,
          image_uri=dummy_container_without_error,
          instance_type=cpu_instance_type,
          sagemaker_session=sagemaker_session,
          use_spot_instances=True,
          max_wait_time_in_seconds=48 * 60 * 60,
      )
      def load_checkpoints(checkpoint_path: Union[str, os.PathLike]):
          file_path_1 = os.path.join(
              checkpoint_path, "checkpoint_1.json"
          )
          with open(file_path_1, "r") as file:
              file_content_1 = file.read()
  
          file_path_2 = os.path.join(
              checkpoint_path, "checkpoint_2.json"
          )
          with open(file_path_2, "r") as file:
              file_content_2 = file.read()
  
          return file_content_1 + file_content_2
  
      assert (
          save_checkpoints(CheckpointLocation(checkpoint_s3_location))
          == CHECKPOINT_FILE_CONTENT
      )
      assert_s3_files_exist(
          sagemaker_session,
          checkpoint_s3_location,
          ["checkpoint_1.json", "checkpoint_2.json"],
      )
  
      assert (
          load_checkpoints(CheckpointLocation(checkpoint_s3_location))
          == CHECKPOINT_FILE_CONTENT + CHECKPOINT_FILE_CONTENT
      )
  
imports: from __future__ import absolute_import
  import time
  from typing import Union
  import pytest
  import os
  import logging
  import random
  import string
  import pandas
  import subprocess
  import shlex
  from sagemaker.experiments.run import Run, load_run
  from sagemaker.remote_function import CheckpointLocation
  from tests.integ.sagemaker.experiments.helpers import cleanup_exp_resources
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.experiments._api_types import _TrialComponentStatusType
  from sagemaker.remote_function import remote
  from sagemaker.remote_function.spark_config import SparkConfig
  from sagemaker.remote_function.custom_file_filter import CustomFileFilter
  from sagemaker.remote_function.runtime_environment.runtime_environment_manager import RuntimeEnvironmentError
  from sagemaker.remote_function.errors import DeserializationError, SerializationError
  from sagemaker.utils import unique_name_from_base
  from tests.integ.kms_utils import get_or_create_kms_key
  from tests.integ import DATA_DIR
  from tests.integ.s3_utils import assert_s3_files_exist
label_desc: Use image node_id 25 for calling a global function with example usage: test_decorator_with_spot_instances_save_and_load_checkpoints(sagemaker_session, dummy_container_without_error, cpu_instance_type, checkpoint_s3_location) and returns: CHECKPOINT_FILE_CONTENT, unknown