code: def get_contrib_summary_df(
      contrib_df, model_output="raw", round=2, units="", na_fill=None
  ):
      """
      returns a DataFrame that summarizes a contrib_df as a pair of
      Reasons+Effect.
  
      Args:
          contrib_df (pd.DataFrame): output from get_contrib_df(...)
          model_output (str, {'raw', 'probability', 'logodds'}): the type of
              predictions that the model produces. 'probability' multiplies by 100
              and adds '%'.
          round (int): number of decimals to round the output to. Defaults to 1.
          units (str): units to add to output. Defaults to "".
          na_fill (int, str): if value equals na_fill replace with "MISSING".
  
      """
      assert model_output in {"raw", "probability", "logodds"}
      contrib_summary_df = pd.DataFrame(columns=["Reason", "Effect"])
  
      for _, row in contrib_df.iterrows():
          if row["col"] == "_BASE":
              reason = "Average of population"
              effect = ""
          elif row["col"] == "_REST":
              reason = "Other features combined"
              effect = f"{'+' if row['contribution'] >= 0 else ''}"
          elif row["col"] == "_PREDICTION":
              reason = "Final prediction"
              effect = ""
          else:
              if na_fill is not None and row["value"] == na_fill:
                  reason = f"{row['col']} = MISSING"
              else:
                  reason = f"{row['col']} = {row['value']}"
  
              effect = f"{'+' if row['contribution'] >= 0 else ''}"
          if model_output == "probability":
              effect += (
                  str(np.round(100 * row["contribution"], round)) + "%"
              )
          elif model_output == "logodds":
              effect += str(np.round(row["contribution"], round))
          else:
              effect += (
                  str(np.round(row["contribution"], round))
                  + f" {units}"
              )
  
          contrib_summary_df = append_dict_to_df(
              contrib_summary_df, dict(Reason=reason, Effect=effect)
          )
  
      return contrib_summary_df.reset_index(drop=True)
  
imports: from functools import partial
  import re
  from collections import Counter
  from typing import List, Union
  import warnings
  import numpy
  import pandas
  from pandas.api.types import is_numeric_dtype, is_categorical_dtype
  from dtreeviz.trees import ShadowDecTree
  from sklearn.metrics import make_scorer
  from sklearn.base import clone
  from sklearn.pipeline import Pipeline
  from sklearn.model_selection import KFold, StratifiedKFold
  from joblib import Parallel, delayed
label_desc: Use image node_id 25 for calling a global function with example usage: get_contrib_summary_df(contrib_df, model_output, round, units, na_fill) and returns: contrib_summary_df