code: def adapt_contributions(case, contributions):
      """
      If _case is "classification" and contributions a np.array or pd.DataFrame
      this function transform contributions matrix in a list of 2 contributions
      matrices: Opposite contributions and contributions matrices.
  
      Parameters
      ----------
      case: string
          String which precised if it's a regression problem or a classification one.
      contributions: pandas.DataFrame, np.ndarray or list
          Contribution of each feature to the predicted value.
  
      Returns
      -------
          pandas.DataFrame, np.ndarray or list
          contributions object modified
      """
      # For classification with numpy arrays, we first transform the last dimension in lists
      # So that we have the following format : [contributions_class_0, contributions_class_1, ...]
      if (
          isinstance(contributions, np.ndarray)
          and contributions.ndim == 3
      ):
          contributions = [
              contributions[:, :, i]
              for i in range(contributions.shape[-1])
          ]
      if (
          isinstance(contributions, pd.DataFrame)
          and case == "classification"
      ) or (
          isinstance(contributions, (np.ndarray, list))
          and case == "classification"
          and np.array(contributions).ndim == 2
      ):
          return [contributions * -1, contributions]
      else:
          return contributions
  
file_path: shapash/shapash/utils/transform.py
imports: from shapash.utils.columntransformer_backend import columntransformer, inv_transform_ct, supported_sklearn, transform_ct, get_col_mapping_ct
  from shapash.utils.category_encoder_backend import transform_ce, inv_transform_ce, supported_category_encoder, get_col_mapping_ce
  import re
  import numpy
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: adapt_contributions(case, contributions) and returns: list, contributions