code: def check_ann_results(
      self,
      metric,
      items,
      query_items,
      k,
      ann_l,
      ann_d,
      err_thresh=0,
      total_thresh=0,
      dists_thresh=0,
  ):
      brute_l, brute_d = brute_force_distances(
          metric, items, query_items, k
      )
      err_total = 0
      for jj in range(query_items.shape[0]):
          err = np.sum(
              np.isin(brute_l[jj, :], ann_l[jj, :], invert=True)
          )
          if err > 0:
              print(
                  f"Warning: {err} labels are missing from ann results (k={k}, err_thresh={err_thresh})"
              )
  
          if err > err_thresh:
              err_total += 1
  
      self.assertLessEqual(
          err_total,
          total_thresh,
          f"Error: knn_query returned incorrect labels for {err_total} items (k={k})",
      )
  
      wrong_dists = np.sum(((brute_d - ann_d) ** 2.0) > 1e-3)
      if wrong_dists > 0:
          dists_count = brute_d.shape[0] * brute_d.shape[1]
          print(
              f"Warning: {wrong_dists} ann distance values are different from brute-force values (total # of values={dists_count}, dists_thresh={dists_thresh})"
          )
  
      self.assertLessEqual(
          wrong_dists,
          dists_thresh,
          msg=f"Error: {wrong_dists} ann distance values are different from brute-force values",
      )
  
file_path: hnswlib/tests/python/bindings_test_pickle.py
imports: import pickle
  import unittest
  import numpy
  import hnswlib
label_desc: Use image node_id 3 for calling a global function with example usage: check_ann_results(metric, items, query_items, k, ann_l, ann_d, err_thresh, total_thresh, dists_thresh) without return types