class_docstr: Initialize the serialization library.
  
  This defines a custom serializer for object refs and also tells ray to
  serialize several exception classes that we define for error handling.
code: def _serialize_to_pickle5(self, metadata, value):
      writer = Pickle5Writer()
      # TODO(swang): Check that contained_object_refs is empty.
      try:
          self.set_in_band_serialization()
          inband = pickle.dumps(
              value, protocol=5, buffer_callback=writer.buffer_callback
          )
      except Exception as e:
          self.get_and_clear_contained_object_refs()
          raise e
      finally:
          self.set_out_of_band_serialization()
  
      return Pickle5SerializedObject(
          metadata,
          inband,
          writer,
          self.get_and_clear_contained_object_refs(),
      )
  
imports: import io
  import logging
  import threading
  import traceback
  from typing import Any
  import google.protobuf.message
  import ray._private.utils
  import ray.cloudpickle
  from ray._private import ray_constants
  from ray._raylet import MessagePackSerializedObject, MessagePackSerializer, DynamicObjectRefGenerator, Pickle5SerializedObject, Pickle5Writer, RawSerializedObject, split_buffer, unpack_pickle5_buffers
  from ray.core.generated.common_pb2 import ErrorType, RayErrorInfo
  from ray.exceptions import ActorPlacementGroupRemoved, ActorUnschedulableError, LocalRayletDiedError, NodeDiedError, ObjectFetchTimedOutError, ObjectLostError, ObjectReconstructionFailedError, ObjectReconstructionFailedLineageEvictedError, ObjectReconstructionFailedMaxAttemptsExceededError, OutOfDiskError, OwnerDiedError, PlasmaObjectNotAvailable, RayActorError, RayError, RaySystemError, RayTaskError, ReferenceCountingAssertionError, ObjectFreedError, RuntimeEnvSetupError, TaskCancelledError, TaskPlacementGroupRemoved, TaskUnschedulableError, WorkerCrashedError, OutOfMemoryError, ObjectRefStreamEndOfStreamError
  from ray.util import serialization_addons
  from ray.util import inspect_serializability
label_desc: Use image node_id 17 for calling the SerializationContext obj's underlying member method code with example usage: obj._serialize_to_pickle5(metadata, value) and returns: Pickle5SerializedObject