code: def _snn_imp(ind, ref_set_):
      """Internal function for fast snn calculation
  
      Parameters
      ----------
      ind : int
          Indices return by kNN.
  
      ref_set_ : int, optional (default=10)
          specifies the number of shared nearest neighbors to create the
          reference set. Note that ref_set must be smaller than n_neighbors.
  
      """
      n = ind.shape[0]
      _count = np.zeros(shape=(n, ref_set_), dtype=np.uint32)
      for i in nb.prange(n):
          temp = np.empty(n, dtype=np.uint32)
          test_element_set = set(ind[i])
          for j in nb.prange(n):
              temp[j] = len(set(ind[j]).intersection(test_element_set))
          temp[i] = np.iinfo(np.uint32).max
          _count[i] = np.argsort(temp)[::-1][1 : ref_set_ + 1]
  
      return _count
  
file_path: pyod/pyod/models/sod.py
imports: import numba
  import numpy
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import check_array
  from .base import BaseDetector
  from ..utils.utility import check_parameter
label_desc: Use image node_id 1 for calling a global function with example usage: _snn_imp(ind, ref_set_) and returns: _count