class_docstr: Class for building, loading and working with Hierarchical Navigable Small World index with SciKit-Learn
  Estimator compatible interface.
  Mostly drop-in replacement for sklearn.neighbors.NearestNeighbors (except for some parameters)
class_docstr_tok: ["Class","for","building",",","loading","and","working","with","Hierarchical","Navigable","Small","World","index","with","SciKit-Learn","Estimator","compatible","interface",".","Mostly","drop-in","replacement","for","sklearn.neighbors.NearestNeighbors","(","except","for","some","parameters",")"]
docstr: Finds the approximate K-neighbors of a point.
  Returns indices of and distances to the neighbors of each point.
  
  Parameters
  ----------
  X : array-like, shape (n_queries, n_features) or None
      The query point or points.
      If not provided, neighbors of each indexed point are returned.
      In this case, the query point is not considered its own neighbor.
  n_neighbors : int, default=None
      Number of neighbors required for each sample. The default is the
      value passed to the constructor.
  return_distance : bool, default=True
      Whether or not to return the distances.
  
  search_neighborhood_size : int, default=None
      Search neighborhood size for ANN-search.
      Higher values improve search quality in expense of search time.
      It should be equal or greater than top_size.
      If None set to n_neighbors * 2.
  
  distance_calc_limit : int (default=0)
      Limit of distance calculation.
      To guarantee satisfactory search time at the expense of quality.
      0 is equivalent to no limit.
  
  Returns
  -------
  neigh_dist :numpy.ndarray of shape (n_queries, n_neighbors)
      Array representing the lengths to points, only present if
      return_distance=True
  neigh_ind : numpy.ndarray of shape (n_queries, n_neighbors)
      Indices of the nearest points in the population matrix.
docstr_tok: ["Finds","the","approximate","K-neighbors","of","a","point",".","Returns","indices","of","and","distances","to","the","neighbors","of","each","point",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_queries",",","n_features",")","or","None","The","query","point","or","points",".","If","not","provided",",","neighbors","of","each","indexed","point","are","returned",".","In","this","case",",","the","query","point","is","not","considered","its","own","neighbor",".","n_neighbors",":","int",",","default=None","Number","of","neighbors","required","for","each","sample",".","The","default","is","the","value","passed","to","the","constructor",".","return_distance",":","bool",",","default=True","Whether","or","not","to","return","the","distances",".","search_neighborhood_size",":","int",",","default=None","Search","neighborhood","size","for","ANN-search",".","Higher","values","improve","search","quality","in","expense","of","search","time",".","It","should","be","equal","or","greater","than","top_size",".","If","None","set","to","n_neighbors","*","2.","distance_calc_limit",":","int","(","default=0",")","Limit","of","distance","calculation",".","To","guarantee","satisfactory","search","time","at","the","expense","of","quality",".","0","is","equivalent","to","no","limit",".","Returns","--","--","--","-","neigh_dist",":","numpy.ndarray","of","shape","(","n_queries",",","n_neighbors",")","Array","representing","the","lengths","to","points",",","only","present","if","return_distance=True","neigh_ind",":","numpy.ndarray","of","shape","(","n_queries",",","n_neighbors",")","Indices","of","the","nearest","points","in","the","population","matrix","."]
code: def kneighbors(
      self,
      X=None,
      n_neighbors=None,
      return_distance=True,
      search_neighborhood_size=None,
      distance_calc_limit=0,
  ):
      """Finds the approximate K-neighbors of a point.
      Returns indices of and distances to the neighbors of each point.
  
      Parameters
      ----------
      X : array-like, shape (n_queries, n_features) or None
          The query point or points.
          If not provided, neighbors of each indexed point are returned.
          In this case, the query point is not considered its own neighbor.
      n_neighbors : int, default=None
          Number of neighbors required for each sample. The default is the
          value passed to the constructor.
      return_distance : bool, default=True
          Whether or not to return the distances.
  
      search_neighborhood_size : int, default=None
          Search neighborhood size for ANN-search.
          Higher values improve search quality in expense of search time.
          It should be equal or greater than top_size.
          If None set to n_neighbors * 2.
  
      distance_calc_limit : int (default=0)
          Limit of distance calculation.
          To guarantee satisfactory search time at the expense of quality.
          0 is equivalent to no limit.
  
      Returns
      -------
      neigh_dist :numpy.ndarray of shape (n_queries, n_neighbors)
          Array representing the lengths to points, only present if
          return_distance=True
      neigh_ind : numpy.ndarray of shape (n_queries, n_neighbors)
          Indices of the nearest points in the population matrix.
      """
      self._check_index()
  
      if X is None:
          X = self._index_data
      if n_neighbors is None:
          n_neighbors = self.n_neighbors
      if search_neighborhood_size is None:
          search_neighborhood_size = n_neighbors * 2
  
      return self._index._kneighbors(
          X,
          n_neighbors,
          return_distance,
          self.distance,
          search_neighborhood_size,
          distance_calc_limit,
      )
  
imports: import sys
  import os
  from six import iteritems
  from enum import IntEnum
  from contextlib import contextmanager
  import json
label_desc: Use image node_id 9 for calling the HnswEstimator obj's underlying member method code with example usage: obj.kneighbors(X, n_neighbors, return_distance, search_neighborhood_size, distance_calc_limit) and returns: self