code: def global_thresholds(
      null_distributions: ImportanceDistributionMap, percentile: float
  ) -> Mapping[int, float]:
      """
      Calculate the required proportion of splits to be selected by variable
  
      Creates a distribution of the _highest_ inclusion percentage of any variable in each of the permuted models
      Threshold is set as a percentile of this distribution
  
      All variables have the same threshold
  
      Note that this is significantly more stringent than the local 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
      """
      q_s = []
      df = pd.DataFrame(null_distributions)
      for row in df.iter_rows():
          q_s.append(np.max(row))
      threshold = np.percentile(q_s, percentile)
      return {feature: threshold 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 6 for calling a global function with example usage: global_thresholds(null_distributions, percentile) and returns: unknown