code: def _test_tf(avg, beta, act, pred, sample_weights, threshold):
      act = tf.constant(act, tf.float32)
      pred = tf.constant(pred, tf.float32)
  
      fbeta = FBetaScore(3, avg, beta, threshold)
      fbeta.update_state(act, pred, sample_weights)
      return fbeta.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 2 for calling a global function with example usage: _test_tf(avg, beta, act, pred, sample_weights, threshold) and returns: fbeta