class_docstr: Class for building and working with Online Hierarchical Navigable Small World index.
class_docstr_tok: ["Class","for","building","and","working","with","Online","Hierarchical","Navigable","Small","World","index","."]
docstr: Create object with given options.
  
  Parameters
  ----------
  dtype : EVectorComponentType
      Type of vectors.
  dimension : int
      Dimension of vectors.
  distance : EDistance
      Distance that should be used for finding nearest vectors.
  max_neighbors : int (default=32)
      Maximum number of neighbors that every item can be connected with.
  search_neighborhood_size : int (default=300)
      Search neighborhood size for ANN-search.
      Higher values improve search quality in expense of building time.
  num_vertices : int (default=0)
      Expected number of vectors in storage.
  level_size_decay : int (default=max_neighbors/2)
      Base of exponent for decaying level sizes.
docstr_tok: ["Create","object","with","given","options",".","Parameters","--","--","--","--","--","dtype",":","EVectorComponentType","Type","of","vectors",".","dimension",":","int","Dimension","of","vectors",".","distance",":","EDistance","Distance","that","should","be","used","for","finding","nearest","vectors",".","max_neighbors",":","int","(","default=32",")","Maximum","number","of","neighbors","that","every","item","can","be","connected","with",".","search_neighborhood_size",":","int","(","default=300",")","Search","neighborhood","size","for","ANN-search",".","Higher","values","improve","search","quality","in","expense","of","building","time",".","num_vertices",":","int","(","default=0",")","Expected","number","of","vectors","in","storage",".","level_size_decay",":","int","(","default=max_neighbors\/2",")","Base","of","exponent","for","decaying","level","sizes","."]
code: def __init__(
      self,
      dtype,
      dimension,
      distance,
      max_neighbors=None,
      search_neighborhood_size=None,
      num_vertices=None,
      level_size_decay=None,
  ):
      """
      Create object with given options.
  
      Parameters
      ----------
      dtype : EVectorComponentType
          Type of vectors.
      dimension : int
          Dimension of vectors.
      distance : EDistance
          Distance that should be used for finding nearest vectors.
      max_neighbors : int (default=32)
          Maximum number of neighbors that every item can be connected with.
      search_neighborhood_size : int (default=300)
          Search neighborhood size for ANN-search.
          Higher values improve search quality in expense of building time.
      num_vertices : int (default=0)
          Expected number of vectors in storage.
      level_size_decay : int (default=max_neighbors/2)
          Base of exponent for decaying level sizes.
      """
      self.dtype = dtype
      self.dimension = dimension
      params = {}
      all_params = [
          "max_neighbors",
          "search_neighborhood_size",
          "num_vertices",
          "level_size_decay",
      ]
      for key, value in iteritems(locals()):
          if key in all_params and value is not None:
              params[key] = value
      self._online_index = _OnlineHnswDenseVectorIndex[dtype](
          dimension, distance, json.dumps(params)
      )
  
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 1 to create a new OnlineHnsw object  with example: obj = OnlineHnsw(dtype, dimension, distance, max_neighbors, search_neighborhood_size, num_vertices, level_size_decay)