code: def smooth_knn(nn_data, local_connectivity=1.0):
      knn_indices, knn_dists, _ = nearest_neighbors(
          nn_data, 10, "euclidean", {}, False, np.random
      )
      sigmas, rhos = smooth_knn_dist(
          knn_dists, 10.0, local_connectivity=local_connectivity
      )
      shifted_dists = knn_dists - rhos[:, np.newaxis]
      shifted_dists[shifted_dists < 0.0] = 0.0
      vals = np.exp(-(shifted_dists / sigmas[:, np.newaxis]))
      norms = np.sum(vals, axis=1)
      return norms
  
file_path: umap/umap/tests/test_umap_nn.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from sklearn.neighbors import KDTree
  from sklearn.preprocessing import normalize
  from umap import distances
  from umap.umap_ import nearest_neighbors, smooth_knn_dist
label_desc: Use image node_id 4 for calling a global function with example usage: smooth_knn(nn_data, local_connectivity) and returns: norms