code: def test_class_weight_and_sample_weight_together(self):
      x = np.random.random((4, 2))
      y = np.array([[0], [1], [2], [3]], dtype="int64")
      sw = np.array([0.5, 0.5, 0.5, 0.5])
      base_ds = tf.data.Dataset.from_tensor_slices((x, y, sw)).batch(16)
      class_weight = {0: 0.1, 1: 0.2, 2: 0.3, 3: 0.4}
  
      with self.assertRaisesRegex(
          ValueError,
          "You cannot `class_weight` and `sample_weight` at the same time.",
      ):
          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 7 for calling the TestTFDatasetAdapter obj's underlying member method code with example usage: obj.test_class_weight_and_sample_weight_together() without return types