def nearestNeighbors(item_id,items_and_sims,n):
    items_and_sims.sort(key=lambda x: x[1][0],reverse=True)
    return item_id, items_and_sims[:n]
Sort the predictions list by similarity and select the top-N neighbors
dataset/ETHPy150Open evancasey/spark-knn-recommender/algorithms/itemBasedRecommender.py/nearestNeighbors