code: def get_shap_interaction_values(x_df, explainer):
      """
      Compute the shap interaction values for a given dataframe.
      Also checks if the explainer is a TreeExplainer.
  
      Parameters
      ----------
      x_df : pd.DataFrame
          DataFrame for which will be computed the interaction values using the explainer.
      explainer : shap.TreeExplainer
          explainer object used to compute the interaction values.
  
      Returns
      -------
      shap_interaction_values : np.ndarray
          Shap interaction values for each sample as an array of shape (# samples x # features x # features).
      """
      if not isinstance(explainer, shap.TreeExplainer):
          raise ValueError(
              f"Explainer type ({type(explainer)}) is not a TreeExplainer. "
              f"Shap interaction values can only be computed for TreeExplainer types"
          )
  
      shap_interaction_values = explainer.shap_interaction_values(x_df)
  
      # For models with vector outputs the previous function returns one array for each output.
      # We sum the contributions here.
      if isinstance(shap_interaction_values, list):
          shap_interaction_values = np.sum(
              shap_interaction_values, axis=0
          )
  
      return shap_interaction_values
  
file_path: shapash/shapash/backend/shap_backend.py
imports: import pandas
  import numpy
  import shap
  from shapash.backend.base_backend import BaseBackend
label_desc: Use image node_id 1 for calling a global function with example usage: get_shap_interaction_values(x_df, explainer) and returns: shap_interaction_values