code: def test_tsw_spectral_init(iris):
      # create an arbitrary (dense) random affinity matrix
      seed = 42
      rng = np.random.default_rng(seed=seed)
      # matrix must be of sufficient size of lobpcg will refuse to work on it
      n = 20
      graph = rng.standard_normal(n * n).reshape((n, n)) ** 2
      graph = graph.T * graph
  
      spec = spectral_layout(None, graph, 2, random_state=seed**2)
      tsw_spec = tswspectral_layout(
          None, graph, 2, random_state=seed**2, tol=1e-8
      )
  
      # Make sure the two methods produce similar embeddings.
      rmsd = np.mean(np.sum((spec - tsw_spec) ** 2, axis=1))
      assert (
          rmsd < 1e-6
      ), "tsvd-warmed spectral init insufficiently close to standard spectral init"
  
imports: from umap.spectral import spectral_layout, tswspectral_layout
  import numpy
  import pytest
  from scipy.version import full_version
  from warnings import catch_warnings
label_desc: Use image node_id 1 for calling a global function with example usage: test_tsw_spectral_init(iris) without return types