code: def upload(
      sagemaker_session: Session,
      model_dir: str,
      bucket: str,
      key_prefix: str,
  ) -> str:
      """Wrapper function of method upload"""
      key = key_prefix + "/serve.tar.gz"
      uploader = Uploader()
      uploader.upload(
          model_dir,
          _get_dir_size(model_dir),
          sagemaker_session.boto_session.get_credentials(),
          sagemaker_session.boto_session.region_name,
          bucket,
          key,
      )
      return s3_path_join("s3://", bucket, key)
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/utils/uploader.py
imports: from __future__ import absolute_import
  import logging
  import os
  import tempfile
  import botocore
  import boto3
  import tqdm
  from sagemaker.session import Session
  from sagemaker.s3_utils import s3_path_join
  from sagemaker.s3 import S3Uploader
  from sagemaker.utils import create_tar_file
label_desc: Use image node_id 2 for calling a global function with example usage: upload(sagemaker_session, model_dir, bucket, key_prefix) and returns: s3_path_join