code: def _update_job_request_with_checkpoint_config(
      args, kwargs, request_dict
  ):
      """Extend job request with checkpoint config based on CheckpointLocation in function args.
  
      Args:
          args (tuple): The positional arguments of the remote function.
          kwargs (Dict): The keyword arguments of the remote function.
          request_dict (Dict): create training job request dict.
      """
      checkpoint_location_index_in_args = None
      checkpoint_location_key_in_kwargs = None
      checkpoint_location_count = 0
  
      for index, arg in enumerate(args):
          if isinstance(arg, CheckpointLocation):
              checkpoint_location_index_in_args = index
              checkpoint_location_count += 1
  
      for key, value in kwargs.items():
          if isinstance(value, CheckpointLocation):
              checkpoint_location_key_in_kwargs = key
              checkpoint_location_count += 1
  
      if checkpoint_location_count < 1:
          return
  
      if checkpoint_location_count > 1:
          raise ValueError(
              "Remote function cannot have more than one argument of type CheckpointLocation."
          )
  
      if checkpoint_location_index_in_args is not None:
          checkpoint_location_arg = args[
              checkpoint_location_index_in_args
          ]
      else:
          checkpoint_location_arg = kwargs[
              checkpoint_location_key_in_kwargs
          ]
  
      checkpoint_s3_uri = checkpoint_location_arg._s3_uri
      checkpoint_local_path = checkpoint_location_arg._local_path
  
      request_dict["CheckpointConfig"] = {
          "LocalPath": checkpoint_local_path,
          "S3Uri": checkpoint_s3_uri,
      }
  
imports: from __future__ import absolute_import
  import dataclasses
  import os
  import re
  import shutil
  import sys
  import json
  import secrets
  from typing import Callable, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
  from urllib.parse import urlparse
  from io import BytesIO
  from sagemaker.config.config_schema import REMOTE_FUNCTION_ENVIRONMENT_VARIABLES, REMOTE_FUNCTION_IMAGE_URI, REMOTE_FUNCTION_DEPENDENCIES, REMOTE_FUNCTION_PRE_EXECUTION_COMMANDS, REMOTE_FUNCTION_PRE_EXECUTION_SCRIPT, REMOTE_FUNCTION_INCLUDE_LOCAL_WORKDIR, REMOTE_FUNCTION_INSTANCE_TYPE, REMOTE_FUNCTION_JOB_CONDA_ENV, REMOTE_FUNCTION_ROLE_ARN, REMOTE_FUNCTION_S3_ROOT_URI, REMOTE_FUNCTION_S3_KMS_KEY_ID, REMOTE_FUNCTION_VOLUME_KMS_KEY_ID, REMOTE_FUNCTION_TAGS, REMOTE_FUNCTION_VPC_CONFIG_SUBNETS, REMOTE_FUNCTION_VPC_CONFIG_SECURITY_GROUP_IDS, REMOTE_FUNCTION_ENABLE_INTER_CONTAINER_TRAFFIC_ENCRYPTION
  from sagemaker.experiments._run_context import _RunContext
  from sagemaker.experiments.run import Run
  from sagemaker.image_uris import get_base_python_image_uri
  from sagemaker import image_uris
  from sagemaker.remote_function.checkpoint_location import CheckpointLocation
  from sagemaker.session import get_execution_role, _logs_for_job, Session
  from sagemaker.utils import name_from_base, _tmpdir, resolve_value_from_config, format_tags, Tags
  from sagemaker.s3 import s3_path_join, S3Uploader
  from sagemaker import vpc_utils
  from sagemaker.remote_function.core.stored_function import StoredFunction, _SerializedData
  from sagemaker.remote_function.core.pipeline_variables import Context
  from sagemaker.remote_function.runtime_environment.runtime_environment_manager import RuntimeEnvironmentManager, _DependencySettings
  from sagemaker.remote_function import logging_config
  from sagemaker.remote_function.spark_config import SparkConfig
  from sagemaker.spark import defaults
  from sagemaker.remote_function.custom_file_filter import CustomFileFilter, copy_workdir, resolve_custom_file_filter_from_config_file
label_desc: Use image node_id 10 for calling a global function with example usage: _update_job_request_with_checkpoint_config(args, kwargs, request_dict) without return types