def get_gae_versions():
    """Gets a list of all of the available Python SDK versions, sorted with
    the newest last."""
    r = requests.get(SDK_RELEASES_URL)
    r.raise_for_status()

    releases = r.json().get('items', {})

    # We only care about the Python releases, which all are in the format
    # "featured/google_appengine_{version}.zip". We'll extract the version
    # number so we can sort the list by version, and finally get the download
    # URL.
    versions_and_urls = []
    for release in releases:
        match = PYTHON_RELEASE_RE.match(release['name'])

        if not match:
            continue

        versions_and_urls.append(
            ([int(x) for x in match.groups()], release['mediaLink']))

    return sorted(versions_and_urls, key=lambda x: x[0])
Gets a list of all of the available Python SDK versions, sorted with
    the newest last.