code: def precision(self, n, n_trees=10, n_points=10000, n_rounds=10):
      found = 0
      for r in xrange(n_rounds):
          # create random points at distance x from (1000, 0, 0, ...)
          f = 10
          i = HnswIndex(f, "L2")
          for j in xrange(n_points):
              p = [random.gauss(0, 1) for z in xrange(f - 1)]
              norm = sum([pi**2 for pi in p]) ** 0.5
              x = [1000] + [pi / norm * j for pi in p]
              i.add_data(x)
  
          i.build()
  
          nns = i.search_by_vector([1000] + [0] * (f - 1), n)
          self.assertEqual(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)
  
imports: import unittest
  import random
  import os
  from n2 import HnswIndex
label_desc: Use image node_id 3 for calling the AngularTest obj's underlying member method code with example usage: obj.precision(n, n_trees, n_points, n_rounds) and returns: unknown