docstr: For a specific pair of methods, calculate the distance between the contributions for all instances.
  
  Parameters
  ----------
  weights : list
      List of contributions from 2 selected methods
  index_i : int
      Index of method 1
  index_j : int
      Index of method 2
  
  Returns
  -------
  l2_dist : array
      Distance between the two selected methods for all instances
docstr_tok: ["For","a","specific","pair","of","methods",",","calculate","the","distance","between","the","contributions","for","all","instances",".","Parameters","--","--","--","--","--","weights",":","list","List","of","contributions","from","2","selected","methods","index_i",":","int","Index","of","method","1","index_j",":","int","Index","of","method","2","Returns","--","--","--","-","l2_dist",":","array","Distance","between","the","two","selected","methods","for","all","instances"]
code: def calculate_pairwise_distances(self, weights, index_i, index_j):
      """
      For a specific pair of methods, calculate the distance between the contributions for all instances.
  
      Parameters
      ----------
      weights : list
          List of contributions from 2 selected methods
      index_i : int
          Index of method 1
      index_j : int
          Index of method 2
  
      Returns
      -------
      l2_dist : array
          Distance between the two selected methods for all instances
      """
      # Normalize weights using L2 norm
      norm_weights_i = (
          weights[index_i]
          / np.linalg.norm(weights[index_i], ord=2, axis=1)[
              :, np.newaxis
          ]
      )
      norm_weights_j = (
          weights[index_j]
          / np.linalg.norm(weights[index_j], ord=2, axis=1)[
              :, np.newaxis
          ]
      )
      # And then take the L2 norm of the difference as a metric
      l2_dist = np.linalg.norm(
          norm_weights_i - norm_weights_j, ord=2, axis=1
      )
  
      return l2_dist
  
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 7 for calling the Consistency obj's underlying member method code with example usage: obj.calculate_pairwise_distances(weights, index_i, index_j) and returns: l2_dist