code: def recall_at(n, n_trees=10, n_points=1000, n_rounds=5):
      # the best movie/variable name
      total_recall = 0.0
  
      for r in range(n_rounds):
          # create random points at distance x
          f = 10
          idx = AnnoyIndex(f, "dot")
  
          data = numpy.array(
              [
                  [random.gauss(0, 1) for z in range(f)]
                  for j in range(n_points)
              ]
          )
  
          expected_results = [
              sorted(
                  range(n_points),
                  key=lambda j: dot_metric(data[i], data[j]),
              )[:n]
              for i in range(n_points)
          ]
  
          for i, vec in enumerate(data):
              idx.add_item(i, vec)
  
          idx.build(n_trees)
  
          for i in range(n_points):
              nns = idx.get_nns_by_vector(data[i], n)
              total_recall += recall(nns, expected_results[i])
  
      return total_recall / float(n_rounds * n_points)
  
file_path: annoy/test/dot_index_test.py
imports: import random
  import numpy
  import pytest
  from annoy import AnnoyIndex
label_desc: Use image node_id 6 for calling a global function with example usage: recall_at(n, n_trees, n_points, n_rounds) and returns: unknown