code: def test_simple_isotonic_regression(self, w, w_dtype, y_dtype):
      # Test case of Busing 2020
      # https://doi.org/10.18637/jss.v102.c01
      y = np.array([8, 4, 8, 2, 2, 0, 8], dtype=y_dtype)
      if w is not None:
          w = np.ones_like(y, dtype=w_dtype)
      res = isotonic_regression(y, weights=w)
      assert res.x.dtype == np.float64
      assert res.weights.dtype == np.float64
      assert_allclose(res.x, [4, 4, 4, 4, 4, 4, 8])
      assert_allclose(res.weights, [6, 1])
      assert_allclose(res.blocks, [0, 6, 7])
      # Assert that y was not overwritten
      assert_equal(y, np.array([8, 4, 8, 2, 2, 0, 8], dtype=np.float64))
  
file_path: scipy/scipy/optimize/tests/test_isotonic_regression.py
imports: import numpy
  from numpy.testing import assert_allclose, assert_equal
  import pytest
  from scipy.optimize._pava_pybind import pava
  from scipy.optimize import isotonic_regression
label_desc: Use image node_id 3 for calling the TestIsotonicRegression obj's underlying member method code with example usage: obj.test_simple_isotonic_regression(w, w_dtype, y_dtype) without return types