code: def test_pruner(self):
      import sklearn
  
      params = {"tree_method": "exact"}
      cancer = sklearn.datasets.load_breast_cancer()
      X = cancer["data"]
      y = cancer["target"]
  
      dtrain = xgb.DMatrix(X, y)
      booster = xgb.train(params, dtrain=dtrain, num_boost_round=10)
      grown = str(booster.get_dump())
  
      params = {
          "updater": "prune",
          "process_type": "update",
          "gamma": "0.2",
      }
      booster = xgb.train(
          params, dtrain=dtrain, num_boost_round=10, xgb_model=booster
      )
      after_prune = str(booster.get_dump())
      assert grown != after_prune
  
      booster = xgb.train(
          params, dtrain=dtrain, num_boost_round=10, xgb_model=booster
      )
      second_prune = str(booster.get_dump())
      # Second prune should not change the tree
      assert after_prune == second_prune
  
imports: import json
  from string import ascii_lowercase
  from typing import Any, Dict
  import numpy
  import pytest
  from hypothesis import given, note, settings, strategies
  import xgboost
  from xgboost import testing
  from xgboost.testing.params import cat_parameter_strategy, exact_parameter_strategy, hist_cache_strategy, hist_parameter_strategy
  from xgboost.testing.updater import check_categorical_missing, check_categorical_ohe, check_get_quantile_cut, check_init_estimation, check_quantile_loss, train_result
label_desc: Use image node_id 3 for calling the TestTreeMethod obj's underlying member method code with example usage: obj.test_pruner() without return types