def METHOD_NAME(request, submission_id, testrun_report_id=None):
    submission = get_submission_or_error(
        request, submission_id, TestRunProgramSubmission
    )
    result = get_testrun_report_or_404(request, submission, testrun_report_id)
    data = result.output_file.read(get_preview_size_limit())
    data, decode_error = decode_str(data)
    size = result.output_file.size
    download_url = reverse(
        'download_testrun_output',
        kwargs={'contest_id': request.contest.id, 'submission_id': submission_id},
    )
    return TemplateResponse(
        request,
        'testrun/data.html',
        {
            'header': _("Output"),
            'data': data,
            'left': size - get_preview_size_limit(),
            'decode_error': decode_error,
            'download_url': download_url,
        },
    )