code: def test_focal_loss_class_weight_is_applied(self, true_class: int):
      class_weight = [1.0, 3.0, 10.0]
      y_pred = tf.constant([[1.0, 1.0, 1.0]]) / 3.0
      y_true = tf.one_hot(true_class, depth=3)[tf.newaxis, :]
      expected_loss = -math.log(1.0 / 3.0) * class_weight[true_class]
  
      loss_fn = loss_functions.FocalLoss(
          gamma=0, class_weight=class_weight
      )
      loss = loss_fn(y_true, y_pred)
      self.assertNear(loss, expected_loss, 1e-4)
  
imports: import math
  import tempfile
  from typing import Dict, Optional, Sequence
  from unittest import mock
  from absl.testing import parameterized
  import tensorflow
  from mediapipe.model_maker.python.core.utils import loss_functions
label_desc: Use image node_id 4 for calling the FocalLossTest obj's underlying member method code with example usage: obj.test_focal_loss_class_weight_is_applied(true_class) without return types