class_docstr: Class to construct and perform search using a BKTree.
docstr: Initialize a root for the BKTree and triggers the tree construction using the dictionary for mapping file names
  and corresponding hashes.
  
  Args:
      hash_dict: Dictionary mapping file names to corresponding hash strings {filename: hash}
      distance_function: A function for calculating distance between the hashes.
docstr_tok: ["Initialize","a","root","for","the","BKTree","and","triggers","the","tree","construction","using","the","dictionary","for","mapping","file","names","and","corresponding","hashes",".","Args",":","hash_dict",":","Dictionary","mapping","file","names","to","corresponding","hash","strings","{","filename",":","hash","}","distance_function",":","A","function","for","calculating","distance","between","the","hashes","."]
code: def __init__(
      self, hash_dict: Dict, distance_function: Callable
  ) -> None:
      """
      Initialize a root for the BKTree and triggers the tree construction using the dictionary for mapping file names
      and corresponding hashes.
  
      Args:
          hash_dict: Dictionary mapping file names to corresponding hash strings {filename: hash}
          distance_function: A function for calculating distance between the hashes.
      """
      self.hash_dict = hash_dict  # database
      self.distance_function = distance_function
      self.all_keys = list(self.hash_dict.keys())
      self.ROOT = self.all_keys[0]
      self.all_keys.remove(self.ROOT)
      self.dict_all = {
          self.ROOT: BkTreeNode(self.ROOT, self.hash_dict[self.ROOT])
      }
      self.candidates = [
          self.dict_all[self.ROOT].node_name
      ]  # Initial value is root
      self.construct_tree()
  
file_path: imagededup/imagededup/handlers/search/bktree.py
imports: import copy
  from typing import Callable, Dict, Tuple
label_desc: Use image node_id 1 to create a new BKTree object  with example: obj = BKTree(hash_dict, distance_function)