def get_paginated_response(data, request):
url = urlparse(request.build_absolute_uri())._replace(query=None).geturl()<EOL>next_page = None<EOL>previous_page = None<EOL>if data['<STR_LIT>']:<EOL><INDENT>next_page = "<STR_LIT>".format(<EOL>base_url=url,<EOL>query_parameters=urlparse(data['<STR_LIT>']).query,<EOL>)<EOL>next_page = next_page.rstrip('<STR_LIT:?>')<EOL><DEDENT>if data['<STR_LIT>']:<EOL><INDENT>previous_page = "<STR_LIT>".format(<EOL>base_url=url,<EOL>query_parameters=urlparse(data['<STR_LIT>'] or "<STR_LIT>").query,<EOL>)<EOL>previous_page = previous_page.rstrip('<STR_LIT:?>')<EOL><DEDENT>return Response(OrderedDict([<EOL>('<STR_LIT:count>', data['<STR_LIT:count>']),<EOL>('<STR_LIT>', next_page),<EOL>('<STR_LIT>', previous_page),<EOL>('<STR_LIT>', data['<STR_LIT>'])<EOL>]))<EOL>
Update pagination links in course catalog data and return DRF Response.

Arguments:
    data (dict): Dictionary containing catalog courses.
    request (HttpRequest): Current request object.

Returns:
    (Response): DRF response object containing pagination links.