code: def test_faiss_query(setup, X, Y, metric):
      faiss_index = build_faiss_index(
          X, "Flat", None, metric=metric, random_state=0
      )
      d, i = faiss_query(faiss_index, Y, 5, nprobe=10)
      distance, indices = fetch(*execute(d, i))
  
      nn = NearestNeighbors(metric=metric)
      nn.fit(x)
      expected_distance, expected_indices = nn.kneighbors(y, 5)
  
      np.testing.assert_array_equal(indices, expected_indices.fetch())
      np.testing.assert_almost_equal(
          distance, expected_distance.fetch(), decimal=4
      )
  
      # test other index
      X2 = X.astype(np.float64)
      Y2 = y.astype(np.float64)
      faiss_index = build_faiss_index(
          X2,
          "PCAR6,IVF8_HNSW32,SQ8",
          10,
          random_state=0,
          return_index_type="object",
      )
      d, i = faiss_query(faiss_index, Y2, 5, nprobe=10)
      # test execute only
      execute(d, i)
  
file_path: mars/mars/learn/neighbors/tests/test_faiss.py
imports: import numpy
  import pytest
  from ....None import tensor
  from ....core import tile
  from ....session import execute, fetch
  from ..None import NearestNeighbors
  from .._faiss import build_faiss_index, _load_index, faiss_query, _gen_index_string_and_sample_count
label_desc: Use image node_id 2 for calling a global function with example usage: test_faiss_query(setup, X, Y, metric) without return types