code: def _get_alpha(self, X, y, sample_weight=None):
      path = self.estimator_.cost_complexity_pruning_path(X, y)
      ccp_alphas, impurities = path.ccp_alphas, path.impurities
      complexities = {}
      low = 0
      high = len(ccp_alphas) - 1
      cur = 0
      while low <= high:
          cur = (high + low) // 2
          est_params = self.estimator_.get_params()
          est_params["ccp_alpha"] = ccp_alphas[cur]
          copied_estimator = deepcopy(self.estimator_).set_params(
              **est_params
          )
          copied_estimator.fit(X, y)
          if (
              self._get_complexity(
                  copied_estimator, self.complexity_measure
              )
              < self.desired_complexity
          ):
              high = cur - 1
          elif (
              self._get_complexity(
                  copied_estimator, self.complexity_measure
              )
              > self.desired_complexity
          ):
              low = cur + 1
          else:
              break
      self.alpha = ccp_alphas[cur]
  
imports: from copy import deepcopy
  from typing import List
  import numpy
  from sklearn import datasets
  from sklearn.base import BaseEstimator
  from sklearn.model_selection import cross_val_score, train_test_split
  from sklearn.tree import DecisionTreeClassifier
  from imodels.tree.hierarchical_shrinkage import HSTreeRegressor, HSTreeClassifier
  from imodels.util.tree import compute_tree_complexity
label_desc: Use image node_id 2 for calling the DecisionTreeCCPRegressor obj's underlying member method code with example usage: obj._get_alpha(X, y, sample_weight) without return types