def identity_benchmark(search_index, docs, n_trials=1000, docs_per_query=50):
    # Bootstrap-ish code to measure the time and accuracy
    times = []
    accuracys = []
    for i in range(n_trials):
        query_index = random.sample(range(len(docs)), docs_per_query)
        time, accuracy = time_it(search_index, docs, query_index)
        time = time / docs_per_query
        times.append(time)
        accuracys.append(accuracy)
    return np.median(times), np.median(accuracys)
dataset/ETHPy150Open facebookresearch/pysparnn/examples/pysparnn_utils.py/identity_benchmark/original