code: def correlations(
      df: pd.DataFrame,
      include_categorical: bool = False,
      plot_type: str = "dendogram",
      plt_kwargs={},
      categorical_cols: List[str] = [],
  ):
      """
      Computes the correlations for the columns provided and plots the relevant
      image as requested by the parameters.
  
      :Example:
  
      cat_df = xai.balance(
          df,
          "gender", "loan",
          upsample=0.8,
          downsample=0.8)
  
      :param df: Pandas Dataframe containing data (inputs and target )
      :type df: pandas.DataFrame
      :param *cross_cols: One or more positional arguments (passed as *args) that
      are used to split the data into the cross product of their values
      :type cross_cols: List[str]
      :param upsample: [Default: 0.5] Target upsample for columns lower
          than percentage.
      :type upsample: float
      :param downsample: [Default: 1] Target downsample for columns higher
          than percentage.
      :type downsample: float
      :param bins: [Default: 6] Number of bins to be used for numerical cols
      :type bins: int
      :param categorical_cols: [Default: []] Columns within dataframe that are
          categorical. Columns that are not np.objects and are not part explicitly
          provided here will be treated as numeric, and bins will be used.
      :type categorical_cols: List[str]
      :param threshold: [Default: 0.5] Threshold to display in the chart.
      :type threshold: float
      :returns: Returns a dataframe containing the correlation values for the features
      :rtype: pandas.DataFrame
  
      """
  
      corr = None
      cols: List = []
      if include_categorical:
          corr = sr(df).correlation
          cols = df.columns
      else:
          if not len(categorical_cols):
              categorical_cols = df.select_dtypes(
                  include=[np.object, np.bool]
              ).columns
  
          cols = [c for c in df.columns if c not in categorical_cols]
  
          corr = df[cols].corr()
          cols = corr.columns
  
      if plot_type == "dendogram":
          _plot_correlation_dendogram(corr, cols, plt_kwargs=plt_kwargs)
      elif plot_type == "matrix":
          _plot_correlation_matrix(corr, cols, plt_kwargs=plt_kwargs)
      else:
          raise ValueError(
              f"Variable plot_type not valid. Provided: {plot_type}"
          )
  
      return corr
  
imports: import pandas
  import matplotlib.pyplot
  import numpy
  from scipy.stats import spearmanr
  from scipy.cluster import hierarchy
  from typing import List, Any, Union, Tuple, Optional, Dict
  import random, math
  from sklearn.metrics import roc_curve, precision_recall_curve, roc_auc_score, confusion_matrix
  import itertools
  import logging
label_desc: Use image node_id 8 for calling a global function with example usage: correlations(df, include_categorical, plot_type, plt_kwargs, categorical_cols) and returns: corr