code: def test_precision_binary_score(self):
      # Arrange
      t, p = _generate_classes_and_scores(
          2, n=100, hard_predictions=True
      )
      targets = turicreate.SArray(t)
      predictions = turicreate.SArray(p)
      str_targets = targets.astype(str)
      str_predictions = predictions.astype(str)
  
      # Act
      skl_score = precision_score(list(targets), list(predictions))
      score = turicreate.toolkits.evaluation.precision(
          targets, predictions
      )
      str_score = turicreate.toolkits.evaluation.precision(
          str_targets, str_predictions
      )
  
      # Assert
      self.assertAlmostEqual(skl_score, score)
      self.assertAlmostEqual(skl_score, str_score)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import turicreate
  from turicreate.toolkits._main import ToolkitError
  import math
  from numpy import inf
  import numpy
label_desc: Use image node_id 17 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_precision_binary_score() without return types