code: def sigma(dists, kth=8):
      num_nodes = dists.shape[0]
  
      # Compute sigma and reshape.
      if kth > num_nodes:
          # Handling for graphs with num_nodes less than kth.
          sigma = np.array([1] * num_nodes).reshape(num_nodes, 1)
      else:
          # Get k-nearest neighbors for each node.
          knns = np.partition(dists, kth, axis=-1)[:, : kth + 1]
          sigma = knns.sum(axis=1).reshape((knns.shape[0], 1)) / kth
  
      return sigma + 1e-8
  
imports: import os
  import pickle
  import numpy
  from scipy.spatial.distance import cdist
  from tqdm import tqdm
  from ..None import backend
  from ..convert import graph
  from .dgl_dataset import DGLDataset
  from .utils import download, extract_archive, load_graphs, save_graphs, Subset
label_desc: Use image node_id 1 for calling a global function with example usage: sigma(dists, kth) and returns: unknown