code: def is_kept(
      feature_proportions: Mapping[int, float],
      thresholds: Mapping[int, float],
  ) -> List[bool]:
      """
      Determine whether each variable should be kept after selection
  
      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[bool]
          An array of length equal to the width of the covariate matrix
          True if the variable should be kept, False otherwise
      """
      print(sorted(list(feature_proportions.keys())))
      return [
          feature_proportions[feature] > thresholds[feature]
          for feature in sorted(list(feature_proportions.keys()))
      ]
  
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 8 for calling a global function with example usage: is_kept(feature_proportions, thresholds) and returns: unknown