code: def test_umap_transform_embedding_stability(
      iris, iris_subset_model, iris_selection
  ):
      """Test that transforming data does not alter the learned embeddings
  
      Issue #217 describes how using transform to embed new data using a
      trained UMAP transformer causes the fitting embedding matrix to change
      in cases when the new data has the same number of rows as the original
      training data.
      """
  
      data = iris.data[iris_selection]
      fitter = iris_subset_model
      original_embedding = fitter.embedding_.copy()
  
      # The important point is that the new data has the same number of rows
      # as the original fit data
      new_data = np.random.random(data.shape)
      _ = fitter.transform(new_data)
  
      assert_array_equal(
          original_embedding,
          fitter.embedding_,
          "Transforming new data changed the original embeddings",
      )
  
      # Example from issue #217
      a = np.random.random((100, 10))
      b = np.random.random((100, 5))
  
      umap = UMAP(n_epochs=100)
      u1 = umap.fit_transform(a[:, :5])
      u1_orig = u1.copy()
      assert_array_equal(u1_orig, umap.embedding_)
  
      _ = umap.transform(b)
      assert_array_equal(u1_orig, umap.embedding_)
  
imports: from sklearn.datasets import make_blobs
  from sklearn.cluster import KMeans
  from sklearn.metrics import adjusted_rand_score, pairwise_distances
  from sklearn.preprocessing import normalize
  from numpy.testing import assert_array_equal
  from umap import UMAP
  from umap.spectral import component_layout
  import numpy
  import scipy.sparse
  import pytest
  import warnings
  from umap.distances import pairwise_special_metric
  from umap.utils import disconnected_vertices
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 7 for calling a global function with example usage: test_umap_transform_embedding_stability(iris, iris_subset_model, iris_selection) without return types