code: def test_infinite_values():
      # Make sure infinite values are properly handled.
      bin_mapper = _BinMapper()
  
      X = np.array([-np.inf, 0, 1, np.inf]).reshape(-1, 1)
  
      bin_mapper.fit(X)
      assert_allclose(
          bin_mapper.bin_thresholds_[0], [-np.inf, 0.5, ALMOST_INF]
      )
      assert bin_mapper.n_bins_non_missing_ == [4]
  
      expected_binned_X = np.array([0, 1, 2, 3]).reshape(-1, 1)
      assert_array_equal(bin_mapper.transform(X), expected_binned_X)
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper, _find_binning_thresholds, _map_to_bins
  from sklearn.ensemble._hist_gradient_boosting.common import ALMOST_INF, X_BINNED_DTYPE, X_DTYPE
  from sklearn.utils._openmp_helpers import _openmp_effective_n_threads
label_desc: Use image node_id 17 for calling a global function with example usage: test_infinite_values() without return types