def recommendations_json(request, name):
    '\n    Get recommended packages for the repo in JSON format\n\n    arguments:\n        :request: GET HTTP request\n        :name: repo name\n\n    returns:\n        JSON object with recommendations\n    '
    repo_name = urllib.parse.unquote_plus(name)
    if (name == DEMO_REPO_INPUT_NAME):
        dependencies = github_util.parse_dependencies(request.session.get('dependencies'), request.session.get('language'))
        branch_name = None
    else:
        if (not request.session.get('github_token')):
            return HttpResponse('Unauthorized', status=401)
        branch_name = request.GET.get('branch', default='master')
        (dependencies, _, _) = github_util.get_dependencies(request.session['github_token'], repo_name, branch_name)
    recommended_dependencies = RECOMMENDER_SERVICE.get_recommendations(dependencies)
    data = {'repository_name': repo_name, 'current_branch': branch_name, 'data': recommended_dependencies}
    return HttpResponse(json.dumps(data), content_type='application/json')
Get recommended packages for the repo in JSON format

arguments:
    :request: GET HTTP request
    :name: repo name

returns:
    JSON object with recommendations
def recommendations_json(request, name):
    '\n    Get recommended packages for the repo in JSON format\n\n    arguments:\n        :request: GET HTTP request\n        :name: repo name\n\n    returns:\n        JSON object with recommendations\n    '
    repo_name = urllib.parse.unquote_plus(name)
    if (name == DEMO_REPO_INPUT_NAME):
        dependencies = github_util.parse_dependencies(request.session.get('dependencies'), request.session.get('language'))
        branch_name = None
    else:
        if (not request.session.get('github_token')):
            return HttpResponse('Unauthorized', status=401)
        branch_name = request.GET.get('branch', default='master')
        (dependencies, _, _) = github_util.get_dependencies(request.session['github_token'], repo_name, branch_name)
    recommended_dependencies = RECOMMENDER_SERVICE.get_recommendations(dependencies)
    data = {'repository_name': repo_name, 'current_branch': branch_name, 'data': recommended_dependencies}
    return HttpResponse(json.dumps(data), content_type='application/json')