code: def test_only_one_item():
      # reported to annoy-user by Kireet Reddy
      idx = AnnoyIndex(100, "angular")
      idx.add_item(0, numpy.random.randn(100))
      idx.build(n_trees=10)
      idx.save("foo.idx")
      idx = AnnoyIndex(100, "angular")
      idx.load("foo.idx")
      assert idx.get_n_items() == 1
      assert idx.get_nns_by_vector(
          vector=numpy.random.randn(100), n=50, include_distances=False
      ) == [0]
  
imports: import random
  import numpy
  import pytest
  from annoy import AnnoyIndex
label_desc: Use image node_id 18 for calling a global function with example usage: test_only_one_item() without return types