code: def local_thresholds(
      null_distributions: ImportanceDistributionMap, percentile: float
  ) -> Mapping[int, float]:
      """
      Calculate the required proportion of splits to be selected by variable
  
      Creates a null distribution for each variable based on the % of splits including that variable in each of the permuted models
  
      Each variable has its own threshold that is independent of the other variables
  
      Note - this is significantly less stringent than the global threshold
  
      Parameters
      ----------
      null_distributions: ImportanceDistributionMap
          A mapping from variable to distribution of split inclusion proportions under the null
      percentile: float
          The percentile of the null distribution to use as a cutoff.
          The closer to 1.0, the more stringent the threshold
  
      Returns
      -------
      Mapping[int, float]
          A lookup from column to % inclusion threshold
      """
      return {
          feature: np.percentile(
              null_distributions[feature], percentile
          )
          for feature in null_distributions
      }
  
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 5 for calling a global function with example usage: local_thresholds(null_distributions, percentile) and returns: unknown