code: def test_focal_loss_with_sample_weight(self):
      y_true = tf.constant(
          [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0], [0, 1, 0]]
      )
      y_pred = tf.constant(
          [
              [0.7, 0.1, 0.2],
              [0.6, 0.3, 0.1],
              [0.1, 0.5, 0.4],
              [0.8, 0.1, 0.1],
              [0.4, 0.5, 0.1],
          ]
      )
  
      focal_loss = loss_functions.FocalLoss(gamma=0)
  
      sample_weight = tf.constant([0.2, 0.2, 0.3, 0.1, 0.2])
  
      self.assertGreater(
          focal_loss(y_true=y_true, y_pred=y_pred),
          focal_loss(
              y_true=y_true, y_pred=y_pred, sample_weight=sample_weight
          ),
      )
  
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 2 for calling the FocalLossTest obj's underlying member method code with example usage: obj.test_focal_loss_with_sample_weight() without return types