code: def main(sys_args=None):
      """Entry point for invoke function script
  
      Args:
          sys_args (list): List of arguments to parse. If not specified, sys.argv is used.
      """
  
      logger = logging_config.get_logger()
  
      exit_code = SUCCESS_EXIT_CODE
  
      try:
          args = _parse_args(sys_args)
          region = args.region
          s3_base_uri = args.s3_base_uri
          s3_kms_key = args.s3_kms_key
          run_in_context = args.run_in_context
          pipeline_context = _load_pipeline_context(args)
  
          hmac_key = os.getenv("REMOTE_FUNCTION_SECRET_KEY")
  
          sagemaker_session = _get_sagemaker_session(region)
          _execute_remote_function(
              sagemaker_session=sagemaker_session,
              s3_base_uri=s3_base_uri,
              s3_kms_key=s3_kms_key,
              run_in_context=run_in_context,
              hmac_key=hmac_key,
              context=pipeline_context,
          )
  
      except Exception as e:  # pylint: disable=broad-except
          logger.exception(
              "Error encountered while invoking the remote function."
          )
          s3_uri = (
              s3_path_join(
                  s3_base_uri,
                  pipeline_context.execution_id,
                  pipeline_context.step_name,
              )
              if pipeline_context.step_name
              else s3_base_uri
          )
          exit_code = handle_error(
              error=e,
              sagemaker_session=sagemaker_session,
              s3_base_uri=s3_uri,
              s3_kms_key=s3_kms_key,
              hmac_key=hmac_key,
          )
      finally:
          sys.exit(exit_code)
  
file_path: sagemaker-python-sdk/src/sagemaker/remote_function/invoke_function.py
imports: from __future__ import absolute_import
  import argparse
  import sys
  import json
  import os
  from typing import TYPE_CHECKING
  import boto3
  from sagemaker.remote_function.job import KEY_EXPERIMENT_NAME, KEY_RUN_NAME
  from sagemaker.session import Session
  from sagemaker.s3 import s3_path_join
  from sagemaker.remote_function.errors import handle_error
  from sagemaker.remote_function import logging_config
  from sagemaker.remote_function.core.pipeline_variables import Context
label_desc: Use image node_id 6 for calling a global function with example usage: main(sys_args) without return types