def METHOD_NAME(repo):
    fileRenameMap = dict()
    renamePattern = re.compile(r"(.*){(.*) => (.*)}(.*)")
    cnt = 0
    for commit in repo.iter_commits():
        cnt += 1
    curr = 0
    for commit in repo.iter_commits():
        curr += 1
        print("Checking commit {}/{}  ->   {}".format(curr, cnt, commit.hexsha))
        for objpath, stats in commit.stats.files.items():
            match = renamePattern.match(objpath)
            if match:
                # the file was renamed, store the rename to follow up later
                oldFile = (match.group(1) + match.group(2) + match.group(4)).replace("//", "/")
                newFile = (match.group(1) + match.group(3) + match.group(4)).replace("//", "/")
                while newFile in fileRenameMap:
                    newFile = fileRenameMap[newFile]
                if oldFile != newFile:
                    fileRenameMap[oldFile] = newFile
            else:
                newFile = fileRenameMap[objpath] if objpath in fileRenameMap else objpath
            if stats['insertions'] > 0:
                if not newFile in fileAuthorStats:
                    fileAuthorStats[newFile] = dict()
                authorName = unicode(commit.author.name)
                if authorName in assumeSameAuthor:
                    authorName = assumeSameAuthor[authorName]
                if not authorName in fileAuthorStats[newFile]:
                    fileAuthorStats[newFile][authorName] = {
                        'years': dict(),
                        'first_commit': commit.committed_datetime
                    }
                elif commit.committed_datetime < fileAuthorStats[newFile][authorName]['first_commit']:
                    fileAuthorStats[newFile][authorName]['first_commit'] = commit.committed_datetime
                if not commit.committed_datetime.year in fileAuthorStats[newFile][authorName]['years']:
                    fileAuthorStats[newFile][authorName]['years'][commit.committed_datetime.year] = 0
                fileAuthorStats[newFile][authorName]['years'][commit.committed_datetime.year] += stats['insertions']