code: def test_umap_knn_graph(n_neighbors):
      data, labels = datasets.make_blobs(
          n_samples=2000, n_features=10, centers=5, random_state=0
      )
      data = data.astype(np.float32)
  
      def fit_transform_embed(knn_graph=None):
          model = cuUMAP(
              random_state=42, init="random", n_neighbors=n_neighbors
          )
          return model.fit_transform(
              data, knn_graph=knn_graph, convert_dtype=True
          )
  
      def transform_embed(knn_graph=None):
          model = cuUMAP(
              random_state=42, init="random", n_neighbors=n_neighbors
          )
          model.fit(data, knn_graph=knn_graph, convert_dtype=True)
          return model.transform(data, convert_dtype=True)
  
      def test_trustworthiness(embedding):
          trust = trustworthiness(
              data, embedding, n_neighbors=n_neighbors
          )
          assert trust >= 0.92
  
      def test_equality(e1, e2):
          mean_diff = np.mean(np.abs(e1 - e2))
          print("mean diff: %s" % mean_diff)
          assert mean_diff < 1.0
  
      neigh = NearestNeighbors(n_neighbors=n_neighbors)
      neigh.fit(data)
      knn_graph = neigh.kneighbors_graph(data, mode="distance")
  
      embedding1 = fit_transform_embed(None)
      embedding2 = fit_transform_embed(knn_graph.tocsr())
      embedding3 = fit_transform_embed(knn_graph.tocoo())
      embedding4 = fit_transform_embed(knn_graph.tocsc())
      embedding5 = transform_embed(knn_graph.tocsr())
      embedding6 = transform_embed(knn_graph.tocoo())
      embedding7 = transform_embed(knn_graph.tocsc())
  
      test_trustworthiness(embedding1)
      test_trustworthiness(embedding2)
      test_trustworthiness(embedding3)
      test_trustworthiness(embedding4)
      test_trustworthiness(embedding5)
      test_trustworthiness(embedding6)
      test_trustworthiness(embedding7)
  
      test_equality(embedding2, embedding3)
      test_equality(embedding3, embedding4)
      test_equality(embedding5, embedding6)
      test_equality(embedding6, embedding7)
  
imports: import platform
  import pytest
  import copy
  import joblib
  from sklearn.metrics import adjusted_rand_score
  from sklearn.manifold import trustworthiness
  from sklearn.datasets import make_blobs
  from sklearn.cluster import KMeans
  from sklearn.neighbors import NearestNeighbors
  from sklearn import datasets
  from cuml.internals import logger
  from cuml.metrics import pairwise_distances
  from cuml.testing.utils import array_equal, unit_param, quality_param, stress_param
  from cuml.manifold.umap import UMAP
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 18 for calling a global function with example usage: test_umap_knn_graph(n_neighbors) and returns: model, model