code: def test_image_similarity(self):
      dataset = self._make_image_dataset()
  
      query_id = dataset.first().id
  
      view1 = dataset.sort_by_similarity(query_id)
      values1 = view1.values("id")
  
      view2 = dataset.sort_by_similarity(query_id, reverse=True)
      values2 = view2.values("id")
  
      self.assertListEqual(values2, values1[::-1])
  
      view3 = dataset.sort_by_similarity(query_id, k=4)
      values3 = view3.values("id")
  
      self.assertListEqual(values3, values1[:4])
  
      view4 = dataset.sort_by_similarity(query_id, brain_key="img_sim")
      values4 = view4.values("id")
  
      self.assertListEqual(values4, values1)
  
      view5 = view4.limit(2)
      values5 = view5.values("id")
  
      self.assertListEqual(values5, values1[:2])
  
      view5.reload()
      values5 = view5.values("id")
  
      self.assertListEqual(values5, values1[:2])
  
file_path: fiftyone/tests/unittests/similarity_tests.py
imports: import unittest
  import numpy
  import fiftyone
  import fiftyone.brain
  from fiftyone.core.brain import BrainMethod
  from fiftyone.core.evaluation import EvaluationMethod
  from decorators import drop_datasets
label_desc: Use image node_id 3 for calling the SimilarityTests obj's underlying member method code with example usage: obj.test_image_similarity() without return types