code: def test_gamma_deviance(self):
      from sklearn.metrics import mean_gamma_deviance
  
      rng = np.random.RandomState(1994)
      n_samples = 100
      n_features = 30
  
      X = rng.randn(n_samples, n_features)
      y = rng.randn(n_samples)
      y = y - y.min() * 100
  
      reg = xgb.XGBRegressor(
          tree_method="hist",
          objective="reg:gamma",
          n_estimators=10,
          eval_metric="gamma-deviance",
      )
      reg.fit(X, y)
  
      booster = reg.get_booster()
      score = reg.predict(X)
      gamma_dev = float(
          booster.eval(xgb.DMatrix(X, y)).split(":")[1].split(":")[0]
      )
      skl_gamma_dev = mean_gamma_deviance(y, score)
      np.testing.assert_allclose(gamma_dev, skl_gamma_dev, rtol=1e-6)
  
imports: import numpy
  import pytest
  import xgboost
  from xgboost import testing
  from xgboost.testing.metrics import check_precision_score, check_quantile_error
label_desc: Use image node_id 6 for calling the TestEvalMetrics obj's underlying member method code with example usage: obj.test_gamma_deviance() without return types