class_docstr: Keeps track of shared object configs when serializing.
code: def __enter__(self):
      if _shared_object_disabled():
          return None
  
      global SHARED_OBJECT_SAVING
  
      # Serialization can happen at a number of layers for a number of
      # reasons.  We may end up with a case where we're opening a saving scope
      # within another saving scope. In that case, we'd like to use the
      # outermost scope available and ignore inner scopes, since there is not
      # (yet) a reasonable use case for having these nested and distinct.
      if _shared_object_saving_scope() is not None:
          self._passthrough = True
          return _shared_object_saving_scope()
      else:
          self._passthrough = False
  
      SHARED_OBJECT_SAVING.scope = self
      self._shared_objects_config = weakref.WeakKeyDictionary()
      self._next_id = 0
      return self
  
imports: import contextlib
  import inspect
  import json
  import threading
  import weakref
  from keras.api_export import keras_export
  from keras.saving import object_registration
label_desc: Use image node_id 1 for calling the SharedObjectSavingScope obj's underlying member method code with example usage: obj.__enter__() and returns: self, None, _shared_object_saving_scope