original_docstring: 
      Compute the laplacian of the transition matrix
  
      Args:
          transition_matrix: Transition matrix
  
      Returns:
          The laplacian of the transition matrix
  
      
docstring: Compute the laplacian of the transition matrix
docstring_tokens: Compute the laplacian of the transition matrix
code: def _compute_laplacian_matrix(transition_matrix):
      """
      Compute the laplacian of the transition matrix
  
      Args:
          transition_matrix: Transition matrix
  
      Returns:
          The laplacian of the transition matrix
  
      """
      n = transition_matrix.shape[0]
      ones = np.ones(n)
      offsets = [0]
  
      alpha = 0.99
      sparse_eye = sparse.dia_matrix((ones, offsets), shape=(n, n), dtype=np.float32)
      laplacian = sparse_eye - alpha * transition_matrix
      return laplacian
code_tokens: def _compute_laplacian_matrix ( transition_matrix ) : n = transition_matrix . shape [ 0 ] ones = np . ones ( n ) offsets = [ 0 ] alpha = 0.99 sparse_eye = sparse . dia_matrix ( ( ones , offsets ) , shape = ( n , n ) , dtype = np . float32 ) laplacian = sparse_eye - alpha * transition_matrix return laplacian
short_docstring: Compute the laplacian of the transition matrix
short_docstring_tokens: Compute the laplacian of the transition matrix
comment: """
      Compute the laplacian of the transition matrix
  
      Args:
          transition_matrix: Transition matrix
  
      Returns:
          The laplacian of the transition matrix
  
      """