original_docstring: 
      Computes resistance distance.
      See http://mathworld.wolfram.com/ResistanceDistance.html.
  
      Note: this procedure requires computing the pseudo inverse of graph
            Laplacian, which is time consuming for large graphs.
      
docstring: Computes resistance distance.
  
  this procedure requires computing the pseudo inverse of graph
  Laplacian, which is time consuming for large graphs.
docstring_tokens: Computes resistance distance . this procedure requires computing the pseudo inverse of graph Laplacian which is time consuming for large graphs .
code: def resistance_distance(graph, pairs):
      """
      Computes resistance distance.
      See http://mathworld.wolfram.com/ResistanceDistance.html.
  
      Note: this procedure requires computing the pseudo inverse of graph
            Laplacian, which is time consuming for large graphs.
      """
      l_inv = np.linalg.pinv(graph.get_laplacian())
      l_inv_diag = np.diag(l_inv).reshape((-1, 1))
      omega = l_inv_diag + l_inv_diag.T - l_inv - l_inv.T
      rd = np.zeros(len(pairs))
      for i, e in enumerate(pairs):
          rd[i] = omega[e[0], e[1]]
      return rd
code_tokens: def resistance_distance ( graph , pairs ) : l_inv = np . linalg . pinv ( graph . get_laplacian ( ) ) l_inv_diag = np . diag ( l_inv ) . reshape ( ( - 1 , 1 ) ) omega = l_inv_diag + l_inv_diag . T - l_inv - l_inv . T rd = np . zeros ( len ( pairs ) ) for i , e in enumerate ( pairs ) : rd [ i ] = omega [ e [ 0 ] , e [ 1 ] ] return rd
short_docstring: Computes resistance distance.
short_docstring_tokens: Computes resistance distance .
comment: """
      Computes resistance distance.
      See http://mathworld.wolfram.com/ResistanceDistance.html.
  
      Note: this procedure requires computing the pseudo inverse of graph
            Laplacian, which is time consuming for large graphs.
      """