code: def test_isotonic_zero_weight_loop():
      # Test from @ogrisel's issue:
      # https://github.com/scikit-learn/scikit-learn/issues/4297
  
      # Get deterministic RNG with seed
      rng = np.random.RandomState(42)
  
      # Create regression and samples
      regression = IsotonicRegression()
      n_samples = 50
      x = np.linspace(-3, 3, n_samples)
      y = x + rng.uniform(size=n_samples)
  
      # Get some random weights and zero out
      w = rng.uniform(size=n_samples)
      w[5:8] = 0
      regression.fit(x, y, sample_weight=w)
  
      # This will hang in failure case.
      regression.fit(x, y, sample_weight=w)
  
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 26 for calling a global function with example usage: test_isotonic_zero_weight_loop() without return types