code: def sort(self):
          
          # First sort commits by author email
          users = []
          # Group commits by author email, so they can be merged
          for _, group in itertools.groupby(sorted(self.commits),
                                            operator.attrgetter('author_mail')):
              if group:
                  users.append(self.merge_user_commits(group))
          # Finally sort by the (aggregated) commits' line counts
          self.sorted_commits = sorted(users,
                                       key=operator.attrgetter('line_count'),
                                       reverse=True)
          return self.sorted_commits
docs: Sort by commit size, per author.