code: def degree_centrality_scores(
      similarity_matrix,
      threshold=None,
      increase_power=True,
  ):
      if not (
          threshold is None
          or isinstance(threshold, float)
          and 0 <= threshold < 1
      ):
          raise ValueError(
              "'threshold' should be a floating-point number "
              "from the interval [0, 1) or None",
          )
  
      if threshold is None:
          markov_matrix = create_markov_matrix(similarity_matrix)
  
      else:
          markov_matrix = create_markov_matrix_discrete(
              similarity_matrix,
              threshold,
          )
  
      scores = stationary_distribution(
          markov_matrix,
          increase_power=increase_power,
          normalized=False,
      )
  
      return scores
  
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 1 for calling a global function with example usage: degree_centrality_scores(similarity_matrix, threshold, increase_power) and returns: scores