code: def test_knn_cpu(self):
      xb = np.random.rand(200, 32).astype("float32")
      xq = np.random.rand(100, 32).astype("float32")
  
      index = faiss.IndexFlatL2(32)
      index.add(xb)
      Dref, Iref = index.search(xq, 10)
  
      Dnew, Inew = knn(xq, xb, 10)
  
      assert np.all(Inew == Iref)
      assert np.allclose(Dref, Dnew)
  
      index = faiss.IndexFlatIP(32)
      index.add(xb)
      Dref, Iref = index.search(xq, 10)
  
      Dnew, Inew = knn(xq, xb, 10, metric=faiss.METRIC_INNER_PRODUCT)
  
      assert np.all(Inew == Iref)
      assert np.allclose(Dref, Dnew)
  
imports: import faiss
  import unittest
  import numpy
  import platform
  import os
  import random
  import tempfile
  from faiss.contrib import datasets
  from faiss.contrib import inspect_tools
  from faiss.contrib import evaluation
  from faiss.contrib import ivf_tools
  from faiss.contrib import clustering
  from faiss.contrib import big_batch_search
  from common_faiss_tests import get_dataset_2
label_desc: Use image node_id 1 for calling the TestExhaustiveSearch obj's underlying member method code with example usage: obj.test_knn_cpu() without return types