code: def _upload_bytes_to_s3(
      b: Union[bytes, io.BytesIO], s3_uri, s3_kms_key, sagemaker_session
  ):
      """Wrapping s3 uploading with exception translation for remote function."""
      try:
          S3Uploader.upload_bytes(
              b,
              s3_uri,
              kms_key=s3_kms_key,
              sagemaker_session=sagemaker_session,
          )
      except Exception as e:
          raise ServiceError(
              "Failed to upload serialized bytes to {}: {}".format(
                  s3_uri, repr(e)
              )
          ) from e
  
imports: from __future__ import absolute_import
  import dataclasses
  import json
  import io
  import sys
  import hmac
  import hashlib
  import pickle
  from typing import Any, Callable, Union
  import cloudpickle
  from tblib import pickling_support
  from sagemaker.remote_function.errors import ServiceError, SerializationError, DeserializationError
  from sagemaker.s3 import S3Downloader, S3Uploader
  from sagemaker.session import Session
  from ._custom_dispatch_table import dispatch_table
label_desc: Use image node_id 10 for calling a global function with example usage: _upload_bytes_to_s3(b, s3_uri, s3_kms_key, sagemaker_session) without return types