code: def test_nested_y_with_class_weight(self):
      x = np.random.random((4, 2))
  
      # Define two target outputs, y1 and y2, for the dataset
      y1 = np.array([0, 1, 2, 3], dtype="int64")
      y2 = np.array([0, 1, 2, 3], dtype="int64")
  
      # Create a tf.data Dataset from the input data and two target outputs
      base_ds = tf.data.Dataset.from_tensor_slices((x, (y1, y2))).batch(
          16
      )
  
      # Define class weights for potential classes in the output
      class_weight = {0: 0.1, 1: 0.2, 2: 0.3, 3: 0.4}
  
      with self.assertRaisesRegex(
          ValueError,
          "`class_weight` is only supported for Models with a single output.",
      ):
          tf_dataset_adapter.TFDatasetAdapter(
              base_ds, class_weight=class_weight
          )
  
file_path: keras/keras/trainers/data_adapters/tf_dataset_adapter_test.py
imports: from unittest import mock
  import numpy
  import tensorflow
  from keras import testing
  from keras.trainers.data_adapters import tf_dataset_adapter
label_desc: Use image node_id 9 for calling the TestTFDatasetAdapter obj's underlying member method code with example usage: obj.test_nested_y_with_class_weight() without return types