docstr: For each instance, measure a distance between contributions from different methods.
  In addition, calculate the mean distance between each pair of method
  
  Parameters
  ----------
  methods : list
      List of methods used in the calculation of contributions
  weights : list
      List of contributions from different methods
  
  Returns
  -------
  all_comparisons : array
      Array containing, for each instance and each pair of methods, the distance between the contribtuions
  mean_distances : DataFrame
      DataFrame storing all pairwise distances between methods
docstr_tok: ["For","each","instance",",","measure","a","distance","between","contributions","from","different","methods",".","In","addition",",","calculate","the","mean","distance","between","each","pair","of","method","Parameters","--","--","--","--","--","methods",":","list","List","of","methods","used","in","the","calculation","of","contributions","weights",":","list","List","of","contributions","from","different","methods","Returns","--","--","--","-","all_comparisons",":","array","Array","containing",",","for","each","instance","and","each","pair","of","methods",",","the","distance","between","the","contribtuions","mean_distances",":","DataFrame","DataFrame","storing","all","pairwise","distances","between","methods"]
code: def calculate_all_distances(self, methods, weights):
      """
      For each instance, measure a distance between contributions from different methods.
      In addition, calculate the mean distance between each pair of method
  
      Parameters
      ----------
      methods : list
          List of methods used in the calculation of contributions
      weights : list
          List of contributions from different methods
  
      Returns
      -------
      all_comparisons : array
          Array containing, for each instance and each pair of methods, the distance between the contribtuions
      mean_distances : DataFrame
          DataFrame storing all pairwise distances between methods
      """
      mean_distances = pd.DataFrame(
          np.zeros((len(methods), len(methods))),
          columns=methods,
          index=methods,
      )
  
      # Initialize a (n choose 2)x4 array (n=num of instances)
      # that will contain : indices of methods that are compared, index of instance, L2 value of instance
      all_comparisons = np.array([np.repeat(None, 4)])
  
      for index_i, index_j in itertools.combinations(
          range(len(methods)), 2
      ):
          l2_dist = self.calculate_pairwise_distances(
              weights, index_i, index_j
          )
          # Populate the (n choose 2)x4 array
          pairwise_comparison = np.column_stack(
              (
                  np.repeat(index_i, len(l2_dist)),
                  np.repeat(index_j, len(l2_dist)),
                  np.arange(len(l2_dist)),
                  l2_dist,
              )
          )
          all_comparisons = np.concatenate(
              (all_comparisons, pairwise_comparison), axis=0
          )
  
          self.calculate_mean_distances(
              methods, mean_distances, index_i, index_j, l2_dist
          )
  
      all_comparisons = all_comparisons[1:, :]
  
      return all_comparisons, mean_distances
  
imports: from category_encoders import OrdinalEncoder
  import copy
  import itertools
  import matplotlib.pyplot
  import numpy
  import pandas
  from plotly import graph_objs
  from plotly.offline import plot
  from plotly.subplots import make_subplots
  from sklearn.manifold import MDS
  from shapash import SmartExplainer
  from shapash.style.style_utils import colors_loading, select_palette, define_style
label_desc: Use image node_id 6 for calling the Consistency obj's underlying member method code with example usage: obj.calculate_all_distances(methods, weights) and returns: all_comparisons,  mean_distances