code: def DISABLED_test_nested_layers(self):
      class MyLayer(layers.Layer):
          def __init__(self, sublayers, **kwargs):
              super().__init__(**kwargs)
              self.sublayers = sublayers
  
          def call(self, x):
              prev_input = x
              for layer in self.sublayers:
                  prev_input = layer(prev_input)
              return prev_input
  
          def get_config(self):
              config = super().get_config()
              config[
                  "sublayers"
              ] = serialization_lib.serialize_keras_object(
                  self.sublayers
              )
              return config
  
          @classmethod
          def from_config(cls, config):
              config[
                  "sublayers"
              ] = serialization_lib.deserialize_keras_object(
                  config["sublayers"]
              )
              return cls(**config)
  
      @object_registration.register_keras_serializable(package="Foo")
      class RegisteredSubLayer(layers.Layer):
          pass
  
      layer = MyLayer(
          [
              layers.Dense(2, name="MyDense"),
              RegisteredSubLayer(name="MySubLayer"),
          ]
      )
      model = models.Sequential([layer])
      with self.subTest("test_JSON"):
          from keras.models.model import model_from_json
  
          model_json = model.to_json()
          self.assertIn("Foo>RegisteredSubLayer", model_json)
  
          loaded_model = model_from_json(
              model_json, custom_objects={"MyLayer": MyLayer}
          )
          loaded_layer = loaded_model.layers[0]
  
          self.assertIsInstance(loaded_layer.sublayers[0], layers.Dense)
          self.assertEqual(loaded_layer.sublayers[0].name, "MyDense")
          self.assertIsInstance(
              loaded_layer.sublayers[1], RegisteredSubLayer
          )
          self.assertEqual(loaded_layer.sublayers[1].name, "MySubLayer")
  
      with self.subTest("test_H5"):
          temp_filepath = os.path.join(self.get_temp_dir(), "model.h5")
          legacy_h5_format.save_model_to_hdf5(model, temp_filepath)
          loaded_model = legacy_h5_format.load_model_from_hdf5(
              temp_filepath, custom_objects={"MyLayer": MyLayer}
          )
          loaded_layer = loaded_model.layers[0]
  
          self.assertIsInstance(loaded_layer.sublayers[0], layers.Dense)
          self.assertEqual(loaded_layer.sublayers[0].name, "MyDense")
          self.assertIsInstance(
              loaded_layer.sublayers[1], RegisteredSubLayer
          )
          self.assertEqual(loaded_layer.sublayers[1].name, "MySubLayer")
  
imports: import os
  import numpy
  import pytest
  import keras
  from keras import layers
  from keras import models
  from keras import ops
  from keras import testing
  from keras.legacy.saving import legacy_h5_format
  from keras.saving import object_registration
  from keras.saving import serialization_lib
label_desc: Use image node_id 9 for calling the LegacyH5WholeModelTest obj's underlying member method code with example usage: obj.DISABLED_test_nested_layers() and returns: prev_input, config, cls