code: def test_gbrt_with_std():
      # simple test of the interface
      rng = np.random.RandomState(1)
      X = rng.uniform(0, 5, 500)[:, np.newaxis]
  
      noise_level = 0.5
      y = truth(X) + rng.normal(0, noise_level, len(X))
      X_ = np.linspace(0, 5, 1000)[:, np.newaxis]
  
      model = GradientBoostingQuantileRegressor()
      model.fit(X, y)
  
      # three quantiles, so three numbers per sample
      assert_array_equal(
          model.predict(X_, return_quantiles=True).shape, (len(X_), 3)
      )
      # "traditional" API which returns one number per sample, in this case
      # just the median/mean
      assert_array_equal(model.predict(X_).shape, (len(X_)))
  
      l, c, h = model.predict(X_, return_quantiles=True).T
      assert_equal(l.shape, c.shape)
      assert_equal(c.shape, h.shape)
      assert_equal(l.shape[0], X_.shape[0])
  
      mean, std = model.predict(X_, return_std=True)
      assert_array_equal(mean, c)
      assert_array_equal(std, (h - l) / 2.0)
  
file_path: scikit-optimize/skopt/learning/tests/test_gbrt.py
imports: import numpy
  import pytest
  from scipy import stats
  from sklearn.ensemble import GradientBoostingRegressor
  from sklearn.ensemble import RandomForestRegressor
  from numpy.testing import assert_equal
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_almost_equal
  from skopt.learning import GradientBoostingQuantileRegressor
label_desc: Use image node_id 4 for calling a global function with example usage: test_gbrt_with_std() without return types