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