code: def test_precision():
      y_targ = [1, 1, 1, 0, 0, 1, 0, 1]
      y_pred = [1, 0, 1, 0, 0, 0, 1, 1]
      res = scoring(
          y_target=y_targ, y_predicted=y_pred, metric="precision"
      )
      assert round(res, 3) == 0.75, res
  
file_path: mlxtend/mlxtend/evaluate/tests/test_scoring.py
imports: import numpy
  from mlxtend.evaluate import scoring
label_desc: Use image node_id 6 for calling a global function with example usage: test_precision() without return types