code: def _power_method(
      transition_matrix, increase_power=True, max_iter=10000
  ):
      eigenvector = np.ones(len(transition_matrix))
  
      if len(eigenvector) == 1:
          return eigenvector
  
      transition = transition_matrix.transpose()
  
      for _ in range(max_iter):
          eigenvector_next = np.dot(transition, eigenvector)
  
          if np.allclose(eigenvector_next, eigenvector):
              return eigenvector_next
  
          eigenvector = eigenvector_next
  
          if increase_power:
              transition = np.dot(transition, transition)
  
      logger.warning(
          "Maximum number of iterations for power method exceeded without convergence!"
      )
      return eigenvector_next
  
file_path: sentence-transformers/examples/applications/text-summarization/LexRank.py
imports: import numpy
  from scipy.sparse.csgraph import connected_components
  from scipy.special import softmax
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: _power_method(transition_matrix, increase_power, max_iter) and returns: eigenvector_next, eigenvector, eigenvector_next