code: def test_ovo_ties():
      # Test that ties are broken using the decision function,
      # not defaulting to the smallest label
      X = np.array([[1, 2], [2, 1], [-2, 1], [-2, -1]])
      y = np.array([2, 0, 1, 2])
      multi_clf = OneVsOneClassifier(
          Perceptron(shuffle=False, max_iter=4, tol=None)
      )
      ovo_prediction = multi_clf.fit(X, y).predict(X)
      ovo_decision = multi_clf.decision_function(X)
  
      # Classifiers are in order 0-1, 0-2, 1-2
      # Use decision_function to compute the votes and the normalized
      # sum_of_confidences, which is used to disambiguate when there is a tie in
      # votes.
      votes = np.round(ovo_decision)
      normalized_confidences = ovo_decision - votes
  
      # For the first point, there is one vote per class
      assert_array_equal(votes[0, :], 1)
      # For the rest, there is no tie and the prediction is the argmax
      assert_array_equal(
          np.argmax(votes[1:], axis=1), ovo_prediction[1:]
      )
      # For the tie, the prediction is the class with the highest score
      assert ovo_prediction[0] == normalized_confidences[0].argmax()
  
imports: from re import escape
  import numpy
  import pytest
  import scipy.sparse
  from numpy.testing import assert_allclose
  from sklearn import datasets, svm
  from sklearn.datasets import load_breast_cancer
  from sklearn.exceptions import NotFittedError
  from sklearn.impute import SimpleImputer
  from sklearn.linear_model import ElasticNet, Lasso, LinearRegression, LogisticRegression, Perceptron, Ridge, SGDClassifier
  from sklearn.metrics import precision_score, recall_score
  from sklearn.model_selection import GridSearchCV, cross_val_score
  from sklearn.multiclass import OneVsOneClassifier, OneVsRestClassifier, OutputCodeClassifier
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.pipeline import Pipeline, make_pipeline
  from sklearn.svm import SVC, LinearSVC
  from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
  from sklearn.utils import check_array, shuffle
  from sklearn.utils._mocking import CheckingClassifier
  from sklearn.utils._testing import assert_almost_equal, assert_array_equal
  from sklearn.utils.fixes import COO_CONTAINERS, CSC_CONTAINERS, CSR_CONTAINERS, DOK_CONTAINERS, LIL_CONTAINERS
  from sklearn.utils.multiclass import check_classification_targets, type_of_target
label_desc: Use image node_id 26 for calling a global function with example usage: test_ovo_ties() without return types