code: def test_results_sorted_in_ascending_distance_order():
      query = {"ukbench00120.jpg": "2b69707551f1b87a"}
      db = {
          "ukbench00120_hflip.jpg": "2b69707551f1b87f",
          "ukbench00120_resize.jpg": "2b69707551f1b87b",
          "ukbench09268_2.jpg": "2b69707551f1b870",
          "ukbench09268_3.jpg": "2c89709251f1b870",
      }
      result = HashEval(
          db,
          query,
          HAMMING_DISTANCE_FUNCTION,
          threshold=30,
          search_method="bktree",
      ).retrieve_results(scores=True)
      distances = [i[1] for v in result.values() for i in v]
  
      assert sorted(distances, reverse=False) == distances
  
file_path: imagededup/tests/test_retrieval.py
imports: import sys
  import pytest
  import numpy
  from sklearn.metrics.pairwise import cosine_similarity
  from imagededup.handlers.search.retrieval import HashEval, cosine_similarity_chunk, get_cosine_similarity
  from imagededup.methods.hashing import Hashing
label_desc: Use image node_id 12 for calling a global function with example usage: test_results_sorted_in_ascending_distance_order() without return types