code: def _wcos(curr_pt, a, b):  # pragma: no cover
      """Internal function to calculate weighted cosine using optimized
      numba code.
  
      Parameters
      ----------
      curr_pt : numpy array of shape (n_samples, n_features)
          Current sample to be calculated.
  
      a : numpy array of shape (n_samples, n_features)
          Training sample a.
  
      b : numpy array of shape (n_samples, n_features)
          Training sample b.
  
      Returns
      -------
      wcos : float in range [-1, 1]
          Cosine similarity between a-curr_pt and b-curr_pt.
  
      """
  
      a_curr = a - curr_pt
      b_curr = b - curr_pt
  
      # wcos = (<a_curr, b_curr>/((|a_curr|*|b_curr|)^2)
      wcos = (
          np.dot(a_curr, b_curr)
          / (np.linalg.norm(a_curr, 2) ** 2)
          / (np.linalg.norm(b_curr, 2) ** 2)
      )
      return wcos
  
imports: from __future__ import division
  from __future__ import print_function
  import warnings
  from itertools import combinations
  import numpy
  from numba import njit
  from sklearn.neighbors import KDTree
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  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: _wcos(curr_pt, a, b) and returns: wcos