code: def true_positives(y, y_pred):
      
  
      y, y_pred = convert_assert(y, y_pred)
      assert_binary_problem(y)
  
      return np.count_nonzero(y_pred[y == 1] == 1)
docs: True-positives
      
      Parameters:
      -----------
      y : vector, shape (n_samples,)
      The target labels.
  
      y_pred : vector, shape (n_samples,)
      The predicted labels.
      
      Returns:
      --------
      tp : integer, the number of true-positives