def METHOD_NAME(self, target_encoding):
    x = np.random.random((4, 2))
    if target_encoding == "int":
        y = np.array([[0], [1], [2], [3]], dtype="int32")
    else:
        y = np.array(
            [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]],
            dtype="float32",
        )
    class_weight = {
        0: 0.1,
        1: 0.2,
        2: 0.3,
        3: 0.4,
    }
    adapter = array_data_adapter.ArrayDataAdapter(
        x,
        y=y,
        class_weight=class_weight,
        batch_size=16,
    )
    gen = adapter.get_numpy_iterator()
    for batch in gen:
        self.assertEqual(len(batch), 3)
        _, _, bw = batch
        self.assertAllClose(bw, [0.1, 0.2, 0.3, 0.4])