Loading
Write `top_k(scores, k)` where `scores` is a dict of document id to similarity score. Return the ids of the `k` highest scores, best first. Break ties by id in alphabetical order so results are stable.
sorted(scores, key=lambda d: (-scores[d], d)) sorts by score high to low, then id.