import re


def _normalize_github_url(url):
    """Normalize a GitHub url so that there is one unique URL representation
    per repo.
    """
    url = re.sub(r'\.git$', '', url)  # Strip trailing .git
    url = re.sub(r'\.$', '', url)  # Strip trailing period
    return url.lower()