code: def test_isotonic_regression():
      y = np.array([3, 7, 5, 9, 8, 7, 10])
      y_ = np.array([3, 6, 6, 8, 8, 8, 10])
      assert_array_equal(y_, isotonic_regression(y))
  
      y = np.array([10, 0, 2])
      y_ = np.array([4, 4, 4])
      assert_array_equal(y_, isotonic_regression(y))
  
      x = np.arange(len(y))
      ir = IsotonicRegression(y_min=0.0, y_max=1.0)
      ir.fit(x, y)
      assert_array_equal(
          ir.fit(x, y).transform(x), ir.fit_transform(x, y)
      )
      assert_array_equal(ir.transform(x), ir.predict(x))
  
      # check that it is immune to permutation
      perm = np.random.permutation(len(y))
      ir = IsotonicRegression(y_min=0.0, y_max=1.0)
      assert_array_equal(
          ir.fit_transform(x[perm], y[perm]),
          ir.fit_transform(x, y)[perm],
      )
      assert_array_equal(ir.transform(x[perm]), ir.transform(x)[perm])
  
      # check we don't crash when all x are equal:
      ir = IsotonicRegression()
      assert_array_equal(
          ir.fit_transform(np.ones(len(x)), y), np.mean(y)
      )
  
imports: import copy
  import pickle
  import warnings
  import numpy
  import pytest
  from scipy.special import expit
  import sklearn
  from sklearn.datasets import make_regression
  from sklearn.isotonic import IsotonicRegression, _make_unique, check_increasing, isotonic_regression
  from sklearn.utils import shuffle
  from sklearn.utils._testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.validation import check_array
label_desc: Use image node_id 8 for calling a global function with example usage: test_isotonic_regression() without return types