code: def _get_value(
      scikit_value,
      mode="regressor",
      scaling=1.0,
      n_classes=2,
      tree_index=0,
  ):
      """Get the right value from the scikit-tree"""
      # Regression
      if mode == "regressor":
          return scikit_value[0] * scaling
  
      # Binary classification
      if n_classes == 2:
          # Decision tree
          if len(scikit_value[0]) != 1:
              value = (
                  scikit_value[0][1] * scaling / scikit_value[0].sum()
              )
          # boosted tree
          else:
              value = scikit_value[0][0] * scaling
          if value == 0.5:
              value = value - 1e-7
  
      # Multiclass classification
      else:
          # Decision tree
          if len(scikit_value[0]) != 1:
              value = scikit_value[0] / scikit_value[0].sum()
          # boosted tree
          else:
              value = {tree_index: scikit_value[0] * scaling}
      return value
  
imports: from ..._deps import _HAS_SKLEARN
  from ...models._feature_management import process_or_validate_features
  from ...models.tree_ensemble import TreeEnsembleClassifier, TreeEnsembleRegressor
label_desc: Use image node_id 1 for calling a global function with example usage: _get_value(scikit_value, mode, scaling, n_classes, tree_index) and returns: value, unknown