code: def __init__(
      self,
      dict_size,
      key_width,
      new_value_shift_coefficient=0.1,
      batch_size=100,
      key_error_threshold=0.01,
      num_neighbors=50,
      override_existing_keys=True,
      rebuild_on_every_update=False,
  ):
      self.rebuild_on_every_update = rebuild_on_every_update
      self.max_size = dict_size
      self.curr_size = 0
      self.new_value_shift_coefficient = new_value_shift_coefficient
      self.num_neighbors = num_neighbors
      self.override_existing_keys = override_existing_keys
  
      self.index = AnnoyIndex(key_width, metric="euclidean")
      self.index.set_seed(1)
  
      self.embeddings = np.zeros((dict_size, key_width))
      self.values = np.zeros(dict_size)
      self.additional_data = [None] * dict_size
  
      self.lru_timestamps = np.zeros(dict_size)
      self.current_timestamp = 0.0
  
      # keys that are in this distance will be considered as the same key
      self.key_error_threshold = key_error_threshold
  
      self.initial_update_size = batch_size
      self.min_update_size = self.initial_update_size
      self.key_dimension = key_width
      self.value_dimension = 1
      self._reset_buffer()
  
      self.built_capacity = 0
  
imports: import os
  import pickle
  import numpy
label_desc: Use image node_id 1 to create a new AnnoyDictionary object from inherited base classes: object with example: obj = AnnoyDictionary(dict_size, key_width, new_value_shift_coefficient, batch_size, key_error_threshold, num_neighbors, override_existing_keys, rebuild_on_every_update)