code: def test_binary_f1_score():
      predictions = pd.Series([0, 0, 1, 1, 0, 0, 0, 1])
      targets = pd.Series([1, 1, 1, 1, 0, 0, 0, 0])
      result = f1_score().eval_fn(predictions, targets, {})
      assert abs(result.aggregate_results["f1_score"] - 0.5713) < 1e-3
  
imports: from unittest import mock
  import pandas
  import pytest
  from mlflow.metrics import MetricValue, ari_grade_level, exact_match, f1_score, flesch_kincaid_grade_level, mae, mape, max_error, mse, ndcg_at_k, precision_at_k, precision_score, r2_score, recall_at_k, recall_score, rmse, rouge1, rouge2, rougeL, rougeLsum, toxicity
label_desc: Use image node_id 20 for calling a global function with example usage: test_binary_f1_score() without return types