human
I wrote the below code

    @wraps(view_func)
    def _inner(request):
        modified_request = request.POST.copy()
        if isinstance(request, HttpRequest):
            request.POST = modified_request
        else:
            request._data = modified_request
        if ('enrollment_action' in modified_request):
            del modified_request['enrollment_action']
        if ('course_id' in modified_request):
            del modified_request['course_id']
        if ('analytics' in modified_request):
            try:
                analytics = json.loads(modified_request['analytics'])
                if ('enroll_course_id' in analytics):
                    modified_request['course_id'] = analytics.get('enroll_course_id')
            except (ValueError, TypeError):
                LOGGER.error(u'Could    not    parse    analytics    object    sent    to    user    API:    {analytics}'.format(analytics=analytics))
        response = view_func(request)
        try:
            response_dict = json.loads(response.content)
            msg = response_dict.get('value', u'')
            success = response_dict.get('success')
        except (ValueError, TypeError):
            msg = response.content
            success = True
        is_authenticated = ((getattr(request, 'user', None) is not None) and request.user.is_authenticated())
        if (check_logged_in and (not is_authenticated)):
            if (response.status_code == 403):
                response.content = 'third-party-auth'
            else:
                response.status_code = 403
                response.content = msg
        elif ((response.status_code != 200) or (not success)):
            if (response.status_code == 200):
                response.status_code = 400
            response.content = msg
        else:
            response.content = msg
        return response
    return _inner

What's a good function header?

=====
Here's a good function header?
assistant
#Here's a good function header.

def shim_student_view(view_func, check_logged_in=False):