code: def test_mnist_with_checkpoint_config(
      sagemaker_session,
      instance_type,
      tensorflow_training_latest_version,
      tensorflow_training_latest_py_version,
  ):
      checkpoint_s3_uri = "s3://{}/checkpoints/tf-{}".format(
          sagemaker_session.default_bucket(), sagemaker_timestamp()
      )
      checkpoint_local_path = "/test/checkpoint/path"
      estimator = TensorFlow(
          entry_point=SCRIPT,
          source_dir=MNIST_RESOURCE_PATH,
          role=ROLE,
          instance_count=1,
          instance_type=instance_type,
          sagemaker_session=sagemaker_session,
          framework_version=tensorflow_training_latest_version,
          py_version=tensorflow_training_latest_py_version,
          metric_definitions=[
              {
                  "Name": "train:global_steps",
                  "Regex": r"global_step\/sec:\s(.*)",
              }
          ],
          checkpoint_s3_uri=checkpoint_s3_uri,
          checkpoint_local_path=checkpoint_local_path,
          environment=ENV_INPUT,
          max_wait=24 * 60 * 60,
          max_retry_attempts=2,
      )
      inputs = estimator.sagemaker_session.upload_data(
          path=os.path.join(MNIST_RESOURCE_PATH, "data"),
          key_prefix="scriptmode/mnist",
      )
  
      training_job_name = unique_name_from_base("test-tf-sm-mnist")
      with tests.integ.timeout.timeout(
          minutes=tests.integ.TRAINING_DEFAULT_TIMEOUT_MINUTES
      ):
          estimator.fit(inputs=inputs, job_name=training_job_name)
      assert_s3_file_patterns_exist(
          sagemaker_session,
          estimator.model_dir,
          [r"model\.ckpt-\d+\.index", r"checkpoint"],
      )
      # remove dataframe assertion to unblock PR build
      # TODO: add independent integration test for `training_job_analytics`
  
      expected_training_checkpoint_config = {
          "S3Uri": checkpoint_s3_uri,
          "LocalPath": checkpoint_local_path,
      }
      actual_training_checkpoint_config = (
          sagemaker_session.sagemaker_client.describe_training_job(
              TrainingJobName=training_job_name
          )["CheckpointConfig"]
      )
      actual_training_environment_variable_config = (
          sagemaker_session.sagemaker_client.describe_training_job(
              TrainingJobName=training_job_name
          )["Environment"]
      )
  
      expected_retry_strategy = {"MaximumRetryAttempts": 2}
      actual_retry_strategy = (
          sagemaker_session.sagemaker_client.describe_training_job(
              TrainingJobName=training_job_name
          )["RetryStrategy"]
      )
      assert (
          actual_training_checkpoint_config
          == expected_training_checkpoint_config
      )
      assert actual_training_environment_variable_config == ENV_INPUT
      assert actual_retry_strategy == expected_retry_strategy
  
imports: from __future__ import absolute_import
  import numpy
  import os
  import time
  import pytest
  from sagemaker.serverless import ServerlessInferenceConfig
  from sagemaker.tensorflow import TensorFlow, TensorFlowProcessor, TensorFlowModel
  from sagemaker.utils import unique_name_from_base, sagemaker_timestamp
  import tests.integ
  from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES, kms_utils, timeout
  from tests.integ.retry import retries
  from tests.integ.utils import gpu_list, retry_with_instance_list
  from tests.integ.s3_utils import assert_s3_file_patterns_exist
  from packaging.version import Version
label_desc: Use image node_id 2 for calling a global function with example usage: test_mnist_with_checkpoint_config(sagemaker_session, instance_type, tensorflow_training_latest_version, tensorflow_training_latest_py_version) without return types