Add a docstring for _adjust_ranks.