code: def _calculate_threshold(estimator, importances, threshold):
      """Interpret the threshold value"""
  
      if threshold is None:
          # determine default from estimator
          est_name = estimator.__class__.__name__
          if (
              hasattr(estimator, "penalty")
              and estimator.penalty == "l1"
          ) or "Lasso" in est_name:
              # the natural default threshold is 0 when l1 penalty was used
              threshold = 1e-5
          else:
              threshold = "mean"
  
      if isinstance(threshold, six.string_types):
          if "*" in threshold:
              scale, reference = threshold.split("*")
              scale = float(scale.strip())
              reference = reference.strip()
  
              if reference == "median":
                  reference = np.median(importances)
              elif reference == "mean":
                  reference = np.mean(importances)
              else:
                  raise ValueError("Unknown reference: " + reference)
  
              threshold = scale * reference
  
          elif threshold == "median":
              threshold = np.median(importances)
  
          elif threshold == "mean":
              threshold = np.mean(importances)
  
          else:
              raise ValueError(
                  "Expected threshold='mean' or threshold='median' "
                  "got %s" % threshold
              )
  
      else:
          threshold = float(threshold)
  
      return threshold
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/feature_selection/from_model.py
imports: import numpy
  from .base import SelectorMixin
  from ..base import TransformerMixin, BaseEstimator, clone
  from ..externals import six
  from ..utils import safe_mask, check_array, deprecated
  from ..utils.validation import check_is_fitted
  from ..exceptions import NotFittedError
label_desc: Use image node_id 2 for calling a global function with example usage: _calculate_threshold(estimator, importances, threshold) and returns: threshold