code: def precision(n, n_trees=10, n_points=10000, n_rounds=10):
      found = 0
      for r in range(n_rounds):
          # create random points at distance x
          f = 10
          i = AnnoyIndex(f, "manhattan")
          for j in range(n_points):
              p = [random.gauss(0, 1) for z in range(f)]
              norm = sum([pi**2 for pi in p]) ** 0.5
              x = [pi / norm + j for pi in p]
              i.add_item(j, x)
  
          i.build(n_trees)
  
          nns = i.get_nns_by_vector([0] * f, n)
          assert nns == sorted(nns)  # should be in order
          # The number of gaps should be equal to the last item minus n-1
          found += len([x for x in nns if x < n])
  
      return 1.0 * found / (n * n_rounds)
  
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 5 for calling a global function with example usage: precision(n, n_trees, n_points, n_rounds) and returns: unknown