code: def spectral_embedding_sb(
      adjacency,
      n_components=8,
      norm_laplacian=True,
      drop_first=True,
  ):
      """Returns spectral embeddings.
  
      Arguments
      ---------
      adjacency : array-like or sparse graph
          shape - (n_samples, n_samples)
          The adjacency matrix of the graph to embed.
      n_components : int
          The dimension of the projection subspace.
      norm_laplacian : bool
          If True, then compute normalized Laplacian.
      drop_first : bool
          Whether to drop the first eigenvector.
  
      Returns
      -------
      embedding : array
          Spectral embeddings for each sample.
  
      Example
      -------
      >>> import numpy as np
      >>> from speechbrain.processing import diarization as diar
      >>> affinity = np.array([[1, 1, 1, 0.5, 0, 0, 0, 0, 0, 0.5],
      ... [1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
      ... [1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
      ... [0.5, 0, 0, 1, 1, 1, 0, 0, 0, 0],
      ... [0, 0, 0, 1, 1, 1, 0, 0, 0, 0],
      ... [0, 0, 0, 1, 1, 1, 0, 0, 0, 0],
      ... [0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
      ... [0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
      ... [0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
      ... [0.5, 0, 0, 0, 0, 0, 1, 1, 1, 1]])
      >>> embs = diar.spectral_embedding_sb(affinity, 3)
      >>> # Notice similar embeddings
      >>> print(np.around(embs , decimals=3))
      [[ 0.075  0.244  0.285]
       [ 0.083  0.356 -0.203]
       [ 0.083  0.356 -0.203]
       [ 0.26  -0.149  0.154]
       [ 0.29  -0.218 -0.11 ]
       [ 0.29  -0.218 -0.11 ]
       [-0.198 -0.084 -0.122]
       [-0.198 -0.084 -0.122]
       [-0.198 -0.084 -0.122]
       [-0.167 -0.044  0.316]]
      """
  
      # Whether to drop the first eigenvector
      if drop_first:
          n_components = n_components + 1
  
      if not _graph_is_connected(adjacency):
          warnings.warn(
              "Graph is not fully connected, spectral embedding"
              " may not work as expected."
          )
  
      laplacian, dd = csgraph_laplacian(
          adjacency, normed=norm_laplacian, return_diag=True
      )
  
      laplacian = _set_diag(laplacian, 1, norm_laplacian)
  
      laplacian *= -1
  
      vals, diffusion_map = eigsh(
          laplacian,
          k=n_components,
          sigma=1.0,
          which="LM",
      )
  
      embedding = diffusion_map.T[n_components::-1]
  
      if norm_laplacian:
          embedding = embedding / dd
  
      embedding = _deterministic_vector_sign_flip(embedding)
      if drop_first:
          return embedding[1:n_components].T
      else:
          return embedding[:n_components].T
  
imports: import csv
  import numbers
  import warnings
  import scipy
  import pytest
  import numpy
  from scipy import sparse
  from scipy.sparse.linalg import eigsh
  from scipy.sparse.csgraph import connected_components
  from scipy.sparse.csgraph import laplacian
label_desc: Use image node_id 14 for calling a global function with example usage: spectral_embedding_sb(adjacency, n_components, norm_laplacian, drop_first) and returns: embedding, embedding