human
Complete this python program:
def allow_jsonp(handler):
assistant
#Here is the Python code you requested.

    """A general wrapper for API views that should be permitted to return JSONP.
    Note: do not use this on views that return sensitive user-specific data, as it
    could allow a 3rd-party attacker site to retrieve and store a user\s information.
    Args:
    The api view, which must return a JsonResponse object, under normal circumstances.
    """
    def allow_jsonp_wrapper_fn(request, *args, **kwargs):
        if (('callback' in request.REQUEST) and (request.method == 'OPTIONS')):
            response = HttpResponse('', content_type='text/plain')
        else:
            response = handler(request, *args, **kwargs)
            if (not isinstance(response, JsonResponse)):
                return response
            elif ('callback' in request.REQUEST):
                response = JsonpResponse(response.content, request.REQUEST['callback'])
        if (('callback' in request.REQUEST) and (request.method in ['OPTIONS', 'GET']) and ('HTTP_ORIGIN' in request.META)):
            response['Access-Control-Allow-Origin'] = request.META['HTTP_ORIGIN']
            response['Access-Control-Allow-Methods'] = 'GET,    OPTIONS'
            response['Access-Control-Max-Age'] = '1000'
            response['Access-Control-Allow-Headers'] = 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since'
        return response
    return allow_jsonp_wrapper_fn