def get_recall(searcher, queries, nns, thresholds=[1, 10, 100, 1000], normalize=True, verbose=False):
    """
    Given a LOPQSearcher object with indexed data and groundtruth nearest neighbors for a set of test
    query vectors, collect and return recall statistics.

    :param LOPQSearcher searcher:
        a searcher that contains the indexed nearest neighbors
    :param ndarray queries:
        a collect of test vectors with vectors on the rows
    :param ndarray nns:
        a list of true nearest neighbor ids for each vector in queries
    :param list thresholds:
        the recall thresholds to evaluate - the last entry defines the number of
        results to retrieve before ranking
    :param bool normalize:
        flag to indicate whether the result should be normalized by the number of queries
    :param bool verbose:
        flag to print every 50th search to visualize progress

    :return list:
        a list of recalls for each specified threshold level
    :return float:
        the elapsed query time
    """

    recall = np.zeros(len(thresholds))
    query_time = 0.0
    for i, d in enumerate(queries):

        nn = nns[i]

        start = time.clock()
        results, cells_visited = searcher.search(d, thresholds[-1])
        query_time += time.clock() - start

        if verbose and i % 50 == 0:
            print '%d cells visitied for query %d' % (cells_visited, i)

        for j, res in enumerate(results):
            rid, code = res

            if rid == nn:
                for k, t in enumerate(thresholds):
                    if j < t:
                        recall[k] += 1

    if normalize:
        N = queries.shape[0]
        return recall / N, N / query_time
    else:
        return recall, query_time
dataset/ETHPy150Open yahoo/lopq/python/lopq/eval.py/get_recall/swapped operands of `/`