code: def test_serialize_deserialize_service_error():
      my_func = lambda a: a + 10  # noqa: E731
  
      s3_uri = random_s3_uri()
      with pytest.raises(
          ServiceError,
          match=rf"Failed to upload serialized bytes to {s3_uri}/payload.pkl: "
          + r"RuntimeError\('some failure when upload_bytes'\)",
      ):
          serialize_func_to_s3(
              func=my_func,
              sagemaker_session=Mock(),
              s3_uri=s3_uri,
              s3_kms_key=KMS_KEY,
              hmac_key=HMAC_KEY,
          )
  
      del my_func
  
      with pytest.raises(
          ServiceError,
          match=rf"Failed to read serialized bytes from {s3_uri}/metadata.json: "
          + r"RuntimeError\('some failure when read_bytes'\)",
      ):
          deserialize_func_from_s3(
              sagemaker_session=Mock(), s3_uri=s3_uri, hmac_key=HMAC_KEY
          )
  
imports: from __future__ import absolute_import
  import random
  import string
  import pytest
  from mock import patch, Mock
  from sagemaker.experiments.run import Run
  from sagemaker.workflow.parameters import ParameterInteger
  from sagemaker.workflow.function_step import DelayedReturn
  from sagemaker.remote_function.core.serialization import serialize_func_to_s3, deserialize_func_from_s3, serialize_obj_to_s3, deserialize_obj_from_s3, serialize_exception_to_s3, deserialize_exception_from_s3
  from sagemaker.remote_function.errors import ServiceError, SerializationError, DeserializationError
  from tblib import pickling_support
label_desc: Use image node_id 21 for calling a global function with example usage: test_serialize_deserialize_service_error() without return types