code: def test_score_pairs_warning(estimator, build_dataset):
      """Tests that score_pairs returns a FutureWarning regarding deprecation.
      Also that score_pairs and pair_distance have the same behaviour"""
      input_data, labels, _, X = build_dataset()
      model = clone(estimator)
      set_random_state(model)
  
      # We fit the metric learner on it and then we call score_pairs on some
      # points
      model.fit(*remove_y(model, input_data, labels))
  
      msg = (
          "score_pairs will be deprecated in release 0.7.0. "
          "Use pair_score to compute similarity scores, or "
          "pair_distances to compute distances."
      )
      with pytest.warns(FutureWarning) as raised_warning:
          score = model.score_pairs(
              [
                  [X[0], X[1]],
              ]
          )
          dist = model.pair_distance(
              [
                  [X[0], X[1]],
              ]
          )
          assert array_equal(score, dist)
      assert any(
          [str(warning.message) == msg for warning in raised_warning]
      )
  
imports: from numpy.core.numeric import array_equal
  import pytest
  import re
  import unittest
  import metric_learn
  import numpy
  from sklearn import clone
  from test.test_utils import ids_metric_learners, metric_learners, remove_y
  from metric_learn.sklearn_shims import set_random_state, SKLEARN_AT_LEAST_0_22
label_desc: Use image node_id 7 for calling a global function with example usage: test_score_pairs_warning(estimator, build_dataset) without return types