code: def test_spectral_embedding_amg_solver(dtype, coo_container, seed=36):
      se_amg = SpectralEmbedding(
          n_components=2,
          affinity="nearest_neighbors",
          eigen_solver="amg",
          n_neighbors=5,
          random_state=np.random.RandomState(seed),
      )
      se_arpack = SpectralEmbedding(
          n_components=2,
          affinity="nearest_neighbors",
          eigen_solver="arpack",
          n_neighbors=5,
          random_state=np.random.RandomState(seed),
      )
      embed_amg = se_amg.fit_transform(S.astype(dtype))
      embed_arpack = se_arpack.fit_transform(S.astype(dtype))
      _assert_equal_with_sign_flipping(embed_amg, embed_arpack, 1e-5)
  
      # same with special case in which amg is not actually used
      # regression test for #10715
      # affinity between nodes
      row = np.array([0, 0, 1, 2, 3, 3, 4], dtype=np.int32)
      col = np.array([1, 2, 2, 3, 4, 5, 5], dtype=np.int32)
      val = np.array([100, 100, 100, 1, 100, 100, 100], dtype=np.int64)
  
      affinity = coo_container(
          (
              np.hstack([val, val]),
              (np.hstack([row, col]), np.hstack([col, row])),
          ),
          shape=(6, 6),
      )
      se_amg.affinity = "precomputed"
      se_arpack.affinity = "precomputed"
      embed_amg = se_amg.fit_transform(affinity.astype(dtype))
      embed_arpack = se_arpack.fit_transform(affinity.astype(dtype))
      _assert_equal_with_sign_flipping(embed_amg, embed_arpack, 1e-5)
  
      # Check that passing a sparse matrix with `np.int64` indices dtype raises an error
      # or is successful based on the version of SciPy which is installed.
      # Use a CSR matrix to avoid any conversion during the validation
      affinity = affinity.tocsr()
      affinity.indptr = affinity.indptr.astype(np.int64)
      affinity.indices = affinity.indices.astype(np.int64)
  
      # PR: https://github.com/scipy/scipy/pull/18913
      # First integration in 1.11.3: https://github.com/scipy/scipy/pull/19279
      scipy_graph_traversal_supports_int64_index = (
          sp_version >= parse_version("1.11.3")
      )
      if scipy_graph_traversal_supports_int64_index:
          se_amg.fit_transform(affinity)
      else:
          err_msg = "Only sparse matrices with 32-bit integer indices are accepted"
          with pytest.raises(ValueError, match=err_msg):
              se_amg.fit_transform(affinity)
  
imports: from unittest.mock import Mock
  import numpy
  import pytest
  from scipy import sparse
  from scipy.linalg import eigh
  from scipy.sparse.linalg import eigsh, lobpcg
  from sklearn.cluster import KMeans
  from sklearn.datasets import make_blobs
  from sklearn.manifold import SpectralEmbedding, _spectral_embedding, spectral_embedding
  from sklearn.manifold._spectral_embedding import _graph_connected_component, _graph_is_connected
  from sklearn.metrics import normalized_mutual_info_score, pairwise_distances
  from sklearn.metrics.pairwise import rbf_kernel
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils._testing import assert_array_almost_equal, assert_array_equal
  from sklearn.utils.extmath import _deterministic_vector_sign_flip
  from sklearn.utils.fixes import COO_CONTAINERS, CSC_CONTAINERS, CSR_CONTAINERS, parse_version, sp_version
  from sklearn.utils.fixes import laplacian
label_desc: Use image node_id 7 for calling a global function with example usage: test_spectral_embedding_amg_solver(dtype, coo_container, seed) without return types