code: def get_knns(self, th=None):
      if th is None or th <= 0.0:
          return self.knns
      # TODO: optimize the filtering process by numpy
      # nproc = mp.cpu_count()
      nproc = 1
      with Timer(
          "filter edges by th {} (CPU={})".format(th, nproc),
          self.verbose,
      ):
          self.th = th
          self.th_knns = []
          tot = len(self.knns)
          if nproc > 1:
              pool = mp.Pool(nproc)
              th_knns = list(
                  tqdm(
                      pool.imap(self.filter_by_th, range(tot)),
                      total=tot,
                  )
              )
              pool.close()
          else:
              th_knns = [self.filter_by_th(i) for i in range(tot)]
          return th_knns
  
file_path: dgl/examples/pytorch/hilander/utils/knn.py
imports: import math
  import multiprocessing
  import os
  import numpy
  from tqdm import tqdm
  from utils import Timer
  from .faiss_search import faiss_search_knn
label_desc: Use image node_id 3 for calling the knn obj's underlying member method code with example usage: obj.get_knns(th) and returns: self, th_knns