code: def test_binary_precision():
      predictions = pd.Series([0, 0, 1, 1, 0, 0, 0, 1])
      targets = pd.Series([1, 1, 1, 1, 0, 0, 0, 0])
      result = precision_score().eval_fn(predictions, targets, {})
      assert (
          abs(result.aggregate_results["precision_score"] == 0.666)
          < 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 19 for calling a global function with example usage: test_binary_precision() without return types