def rest_get_pr_changes(script, project_key, repo_slug, pr_id, change_scope="unreviewed"):
    """
    Get the code changes for the PR
    :param script: a TestScript instance
    :type script: TestScript
    :param project_key: the project key
    :type project_key: str
    :param repo_slug: the repo slug
    :type repo_slug: str
    :param pr_id: the pull request id
    :type pr_id: str
    :param change_scope: the change scope (default is unreviewed)
    :type change_scope: str
    :return: The changes
    :rtype: dict
    """
    changes_url = "/rest/api/latest/projects/%s/repos/%s/pull-requests/%s/changes" % (project_key, repo_slug, pr_id)
    query_params = {
        "start": "0",
        "limit": "1000",
        "changeScope": change_scope
    }
    return script.rest("GET", changes_url, query_params)