code: def test_accuracy_toy_example(estimator, build_dataset):
      """Test that the default scoring for quadruplets (accuracy) works on some
      toy example"""
      input_data, labels, preprocessor, X = build_dataset(
          with_preprocessor=False
      )
      estimator = clone(estimator)
      estimator.set_params(preprocessor=preprocessor)
      set_random_state(estimator)
      estimator.fit(input_data)
      # We take the two first points and we build 4 regularly spaced points on the
      # line they define, so that it's easy to build quadruplets of different
      # similarities.
      X_test = X[0] + np.arange(4)[:, np.newaxis] * (X[0] - X[1]) / 4
      quadruplets_test = np.array(
          [
              [X_test[0], X_test[2], X_test[0], X_test[1]],
              [X_test[1], X_test[3], X_test[1], X_test[0]],
              [X_test[1], X_test[2], X_test[0], X_test[3]],
              [X_test[3], X_test[0], X_test[2], X_test[1]],
          ]
      )
      # we force the transformation to be identity so that we control what it does
      estimator.components_ = np.eye(X.shape[1])
      assert estimator.score(quadruplets_test) == 0.25
  
file_path: metric-learn/test/test_quadruplets_classifiers.py
imports: import pytest
  from sklearn.exceptions import NotFittedError
  from sklearn.model_selection import train_test_split
  from test.test_utils import quadruplets_learners, ids_quadruplets_learners
  from metric_learn.sklearn_shims import set_random_state
  from sklearn import clone
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: test_accuracy_toy_example(estimator, build_dataset) without return types