code: def test_weighted_percentile():
      y = np.empty(102, dtype=np.float64)
      y[:50] = 0
      y[-51:] = 2
      y[-1] = 100000
      y[50] = 1
      sw = np.ones(102, dtype=np.float64)
      sw[-1] = 0.0
      score = _weighted_percentile(y, sw, 50)
      assert approx(score) == 1
  
file_path: scikit-learn/sklearn/utils/tests/test_stats.py
imports: import numpy
  from numpy.testing import assert_allclose
  from pytest import approx
  from sklearn.utils.stats import _weighted_percentile
label_desc: Use image node_id 1 for calling a global function with example usage: test_weighted_percentile() without return types