code: def predict_proba(self, X, queue=None):
      neigh_dist, neigh_ind = self.kneighbors(X, queue=queue)
  
      classes_ = self.classes_
      _y = self._y
      if not self.outputs_2d_:
          _y = self._y.reshape((-1, 1))
          classes_ = [self.classes_]
  
      n_queries = _num_samples(X)
  
      weights = self._get_weights(neigh_dist, self.weights)
      if weights is None:
          weights = np.ones_like(neigh_ind)
  
      all_rows = np.arange(n_queries)
      probabilities = []
      for k, classes_k in enumerate(classes_):
          pred_labels = _y[:, k][neigh_ind]
          proba_k = np.zeros((n_queries, classes_k.size))
  
          # a simple ':' index doesn't work right
          for i, idx in enumerate(
              pred_labels.T
          ):  # loop is O(n_neighbors)
              proba_k[all_rows, idx] += weights[:, i]
  
          # normalize 'votes' into real [0,1] probabilities
          normalizer = proba_k.sum(axis=1)[:, np.newaxis]
          normalizer[normalizer == 0.0] = 1.0
          proba_k /= normalizer
  
          probabilities.append(proba_k)
  
      if not self.outputs_2d_:
          probabilities = probabilities[0]
  
      return probabilities
  
imports: from abc import ABCMeta
  from numbers import Integral
  import numpy
  from daal4py import bf_knn_classification_prediction, bf_knn_classification_training, kdtree_knn_classification_prediction, kdtree_knn_classification_training
  from onedal import _backend
  from ..common._estimator_checks import _check_is_fitted, _is_classifier, _is_regressor
  from ..common._mixin import ClassifierMixin, RegressorMixin
  from ..common._policy import _get_policy
  from ..datatypes import _convert_to_supported, from_table, to_table
  from ..utils import _check_array, _check_classification_targets, _check_n_features, _check_X_y, _column_or_1d, _num_samples
label_desc: Use image node_id 8 for calling the KNeighborsClassifier obj's underlying member method code with example usage: obj.predict_proba(X, queue) and returns: probabilities