class_docstr: Class to perform search using a Brute force.
class_docstr_tok: ["Class","to","perform","search","using","a","Brute","force","."]
docstr: Function for searching using brute force.
  
  Args:
      query: hash string for which brute force needs to work.
      tol: distance upto which duplicate is valid.
  
  Returns:
      List of tuples of the form [(valid_retrieval_filename1: distance), (valid_retrieval_filename2: distance)]
docstr_tok: ["Function","for","searching","using","brute","force",".","Args",":","query",":","hash","string","for","which","brute","force","needs","to","work",".","tol",":","distance","upto","which","duplicate","is","valid",".","Returns",":","List","of","tuples","of","the","form","[","(","valid_retrieval_filename1",":","distance",")",",","(","valid_retrieval_filename2",":","distance",")","]"]
code: def search(self, query: str, tol: int = 10) -> Dict[str, int]:
      """
      Function for searching using brute force.
  
      Args:
          query: hash string for which brute force needs to work.
          tol: distance upto which duplicate is valid.
  
      Returns:
          List of tuples of the form [(valid_retrieval_filename1: distance), (valid_retrieval_filename2: distance)]
      """
  
      filenames = []
      hash_vals = []
      for filename, hash_val in self.hash_dict.items():
          filenames.append(filename.encode("utf-8"))
          hash_vals.append(int(hash_val, 16))
  
      return brute_force_cython_ext.query(
          filenames, hash_vals, int(query, 16), tol
      )
  
imports: from typing import Callable, Dict
  import brute_force_cython_ext
label_desc: Use image node_id 2 for calling the BruteForceCython obj's underlying member method code with example usage: obj.search(query, tol) and returns: brute_force_cython_ext