code: def stationary_distribution(
      transition_matrix,
      increase_power=True,
      normalized=True,
  ):
      n_1, n_2 = transition_matrix.shape
      if n_1 != n_2:
          raise ValueError("'transition_matrix' should be square")
  
      distribution = np.zeros(n_1)
  
      grouped_indices = connected_nodes(transition_matrix)
  
      for group in grouped_indices:
          t_matrix = transition_matrix[np.ix_(group, group)]
          eigenvector = _power_method(
              t_matrix, increase_power=increase_power
          )
          distribution[group] = eigenvector
  
      if normalized:
          distribution /= n_1
  
      return distribution
  
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 6 for calling a global function with example usage: stationary_distribution(transition_matrix, increase_power, normalized) and returns: distribution