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 add_contained_object_ref(self, object_ref):
      if self.is_in_band_serialization():
          # This object ref is being stored in an object. Add the ID to the
          # list of IDs contained in the object so that we keep the inner
          # object value alive as long as the outer object is in scope.
          if not hasattr(self._thread_local, "object_refs"):
              self._thread_local.object_refs = set()
          self._thread_local.object_refs.add(object_ref)
      else:
          # If this serialization is out-of-band (e.g., from a call to
          # cloudpickle directly or captured in a remote function/actor),
          # then pin the object for the lifetime of this worker by adding
          # a local reference that won't ever be removed.
          ray._private.worker.global_worker.core_worker.add_object_ref_reference(
              object_ref
          )
  
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 10 for calling the SerializationContext obj's underlying member method code with example usage: obj.add_contained_object_ref(object_ref) without return types