code: def subgraph_centrality(CIJ):
      '''
      The subgraph centrality of a node is a weighted sum of closed walks of
      different lengths in the network starting and ending at the node. This
      function returns a vector of subgraph centralities for each node of the
      network.
  
      Parameters
      ----------
      CIJ : NxN np.ndarray
          binary adjacency matrix
  
      Cs : Nx1 np.ndarray
          subgraph centrality
      '''
      from scipy import linalg
  
      vals, vecs = linalg.eig(CIJ)  # compute eigendecomposition
      # lambdas=np.diag(vals)
      # compute eigenvector centr.
      Cs = np.real(np.dot(vecs * vecs, np.exp(vals)))
      return Cf subgraph_centrality(CIJ):
      '''
      The subgraph centrality of a node is a weighted sum of closed walks of
      different lengths in the network starting and ending at the node. This
      function returns a vector of subgraph centralities for each node of the
      network.
  
      Parameters
      ----------
      CIJ : NxN np.ndarray
          binary adjacency matrix
  
      Cs : Nx1 np.ndarray
          subgraph centrality
      '''
      from scipy import linalg
  
      vals, vecs = linalg.eig(CIJ)  # compute eigendecomposition
      # lambdas=np.diag(vals)
      # compute eigenvector centr.
      Cs = np.real(np.dot(vecs * vecs, np.exp(vals)))
      return Cs
docs: The subgraph centrality of a node is a weighted sum of closed walks of
      different lengths in the network starting and ending at the node. This
      function returns a vector of subgraph centralities for each node of the
      network.
  
      Parameters
      ----------
      CIJ : NxN np.ndarray
          binary adjacency matrix
  
      Cs : Nx1 np.ndarray
          subgraph centrality