code: def test_sample_eq():
      f1 = F1Score(3)
      f1_weighted = F1Score(3)
  
      preds = [
          [0.9, 0.1, 0],
          [0.2, 0.6, 0.2],
          [0, 0, 1],
          [0.4, 0.3, 0.3],
          [0, 0.9, 0.1],
          [0, 0, 1],
      ]
      actuals = [
          [1, 0, 0],
          [0, 1, 0],
          [0, 0, 1],
          [1, 0, 0],
          [1, 0, 0],
          [0, 0, 1],
      ]
      sample_weights = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
  
      f1.update_state(actuals, preds)
      f1_weighted(actuals, preds, sample_weights)
      np.testing.assert_allclose(
          f1.result().numpy(), f1_weighted.result().numpy()
      )
  
file_path: rasa/tests/utils/tensorflow/test_metrics.py
imports: import numpy
  import pytest
  import tensorflow
  from rasa.utils.tensorflow.metrics import FBetaScore, F1Score
label_desc: Use image node_id 10 for calling a global function with example usage: test_sample_eq() without return types