code: def test_disconnected_data_precomputed(num_isolates, sparse):
      disconnected_data = np.random.choice(
          a=[False, True], size=(10, 20), p=[0.66, 1 - 0.66]
      )
      # Add some disconnected data for the corner case test
      disconnected_data = np.vstack(
          [
              disconnected_data,
              np.zeros((num_isolates, 20), dtype="bool"),
          ]
      )
      new_columns = np.zeros(
          (num_isolates + 10, num_isolates), dtype="bool"
      )
      for i in range(num_isolates):
          new_columns[10 + i, i] = True
      disconnected_data = np.hstack([disconnected_data, new_columns])
      dmat = pairwise_special_metric(disconnected_data)
      if sparse:
          dmat = csr_matrix(dmat)
      model = UMAP(
          n_neighbors=3, metric="precomputed", disconnection_distance=1
      ).fit(dmat)
  
      # Check that the first isolate has no edges in our umap.graph_
      isolated_vertices = disconnected_vertices(model)
      assert isolated_vertices[10] == True
      number_of_nan = np.sum(
          np.isnan(model.embedding_[isolated_vertices])
      )
      assert number_of_nan >= num_isolates * model.n_components
  
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 5 for calling a global function with example usage: test_disconnected_data_precomputed(num_isolates, sparse) without return types