code: def distance_sklearn_metrics(z, k=4, metric="euclidean"):
      """Compute pairwise distances"""
      # d = sklearn.metrics.pairwise.pairwise_distances(z, metric=metric, n_jobs=-2)
      d = sklearn.metrics.pairwise.pairwise_distances(
          z, metric=metric, n_jobs=1
      )
      # k-NN
      idx = np.argsort(d)[:, 1 : k + 1]
      d.sort()
      d = d[:, 1 : k + 1]
      return d, idx
  
file_path: dgl/examples/pytorch/model_zoo/geometric/grid_graph.py
imports: import numpy
  import scipy.sparse
  import scipy.sparse.linalg
  import sklearn
  import sklearn.metrics
label_desc: Use image node_id 3 for calling a global function with example usage: distance_sklearn_metrics(z, k, metric) and returns: d,  idx