code: def kept_features(
      feature_proportions: Mapping[int, float],
      thresholds: Mapping[int, float],
  ) -> List[int]:
      """
      Extract the features to keep
  
      Parameters
      ----------
      feature_proportions: Mapping[int, float]
          Lookup from variable to % of splits in the model that use that variable
      thresholds:  Mapping[int, float]
          Lookup from variable to required % of splits in the model to be kept
  
      Returns
      -------
      List[int]
          Variable selected for inclusion in the final model
      """
      return [
          x[0]
          for x in zip(
              sorted(feature_proportions.keys()),
              is_kept(feature_proportions, thresholds),
          )
          if x[1]
      ]
  
file_path: imodels/imodels/experimental/bartpy/diagnostics/features.py
imports: from collections import Counter
  from typing import List, Mapping, Union, Optional
  import numpy
  import pandas
  import seaborn
  from matplotlib import pyplot
  from ..runner import run_models
  from ..sklearnmodel import SklearnModel
label_desc: Use image node_id 7 for calling a global function with example usage: kept_features(feature_proportions, thresholds) and returns: unknown