code: def test_get_nns_with_distances():
      f = 3
      i = AnnoyIndex(f, "manhattan")
      i.add_item(0, [0, 0, 2])
      i.add_item(1, [0, 1, 1])
      i.add_item(2, [1, 0, 0])
      i.build(10)
  
      l, d = i.get_nns_by_item(0, 3, -1, True)
      assert l == [0, 1, 2]
      assert d[0] == pytest.approx(0)
      assert d[1] == pytest.approx(2)
      assert d[2] == pytest.approx(3)
  
      l, d = i.get_nns_by_vector([2, 2, 1], 3, -1, True)
      assert l == [1, 2, 0]
      assert d[0] == pytest.approx(3)
      assert d[1] == pytest.approx(4)
      assert d[2] == pytest.approx(5)
  
file_path: annoy/test/manhattan_index_test.py
imports: import random
  import numpy
  import pytest
  from annoy import AnnoyIndex
label_desc: Use image node_id 10 for calling a global function with example usage: test_get_nns_with_distances() without return types