def github_api_url(project_url_parts):
    """
    Return the appropriate Github API URL for the given parsed project_url.
    """
    # If this is a Github URL, use api.github.com. Otherwise use /api/v3/
    api_url = None
    if project_url_parts.netloc == 'github.com':
        api_url = project_url_parts._replace(
            netloc='api.' + project_url_parts.netloc,
            path='')
    else:
        api_url = project_url_parts._replace(
            path='/api/v3')

    return api_url