code: def test_get_nns_by_vector():
      f = 3
      i = AnnoyIndex(f, "angular")
      i.add_item(0, [0, 0, 1])
      i.add_item(1, [0, 1, 0])
      i.add_item(2, [1, 0, 0])
      i.build(10)
  
      assert i.get_nns_by_vector([3, 2, 1], 3) == [2, 1, 0]
      assert i.get_nns_by_vector([1, 2, 3], 3) == [0, 1, 2]
      assert i.get_nns_by_vector([2, 0, 1], 3) == [2, 0, 1]
  
imports: import random
  import numpy
  import pytest
  from annoy import AnnoyIndex
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_nns_by_vector() without return types