def _ranking(self, person, author_commits):
        count_to_author = {}
        for author, commits in author_commits.items():
            commit_count = len(commits)
            count_to_author.setdefault(commit_count, list()).append(author)
        ranking = 1
        count_order = list(sorted(count_to_author.keys(), reverse=True))
        for count in count_order:
            authors = count_to_author[count]
            if person in authors:
                break
            ranking += len(authors)
        last_place = 1
        for count in count_order[:-1]:
            last_place += len(count_to_author[count])
        return ranking, last_place
Calculate the ranking of someone.
dataset/ETHPy150Open brettcannon/free-labour/freelabour/project.py/Project._ranking