class_docstr: Class to construct and perform search using a BKTree.
docstr: Function to insert a new node into the BKTree.
  
  Args:
      k: filename for inserting into the BKTree.
      current_node: Node of the tree to which the new node should be added.
  
  Return:
      0 for successful execution.
docstr_tok: ["Function","to","insert","a","new","node","into","the","BKTree",".","Args",":","k",":","filename","for","inserting","into","the","BKTree",".","current_node",":","Node","of","the","tree","to","which","the","new","node","should","be","added",".","Return",":","0","for","successful","execution","."]
code: def _insert_in_tree(self, k: str, current_node: str) -> int:
      """
      Function to insert a new node into the BKTree.
  
      Args:
          k: filename for inserting into the BKTree.
          current_node: Node of the tree to which the new node should be added.
  
      Return:
          0 for successful execution.
      """
      dist_current_node = self.distance_function(
          self.hash_dict[k], self.dict_all[current_node].node_value
      )
      condition_insert_current_node_child = (
          not self.dict_all[current_node].children
      ) or (
          dist_current_node
          not in list(self.dict_all[current_node].children.values())
      )
      if condition_insert_current_node_child:
          self.dict_all[current_node].children[k] = dist_current_node
          self.dict_all[k] = BkTreeNode(
              k, self.hash_dict[k], parent_name=current_node
          )
      else:
          for i, val in self.dict_all[current_node].children.items():
              if val == dist_current_node:
                  node_to_add_to = i
                  break
          self._insert_in_tree(k, node_to_add_to)
      return 0
  
file_path: imagededup/imagededup/handlers/search/bktree.py
imports: import copy
  from typing import Callable, Dict, Tuple
label_desc: Use image node_id 2 for calling the BKTree obj's underlying member method code with example usage: obj._insert_in_tree(k, current_node) and returns: int