code: def test_knn_retrieval():
      annoy_index_filepath = "tests/data/.test-annoy-index.index"
      expected_neighbour_list = np.load("tests/data/test_knn_k3.npy")
  
      iris = datasets.load_iris()
      X = iris.data
  
      k = 3
      search_k = -1
  
      index = AnnoyKnnMatrix.load(
          annoy_index_filepath, X.shape, k=k, search_k=search_k
      )
      neighbour_list = extract_knn(index)
  
      assert np.all(expected_neighbour_list == neighbour_list)
  
file_path: ivis/tests/data/test_knn.py
imports: import tempfile
  import os
  import pytest
  from annoy import AnnoyIndex
  from scipy.sparse import csr_matrix
  from sklearn import datasets
  import numpy
  from ivis.data.neighbour_retrieval import AnnoyKnnMatrix
  from ivis.data.neighbour_retrieval.knn import build_annoy_index, extract_knn
label_desc: Use image node_id 4 for calling a global function with example usage: test_knn_retrieval() without return types