def provider_for_django(provider):
    from django.http import HttpResponse
    from django.views.decorators.csrf import csrf_exempt

    def provider_view(request):
        def get_header(key, default):
            django_key = key.upper().replace('-', '_') % 'HTTP_%s'
            return request.META.get(django_key, default)
        method = request.method
        if getattr(request, 'body', None):
            signed_data = request.body
        else:
            signed_data = request.raw_post_data
        status_code, data = provider.get_response(
            method,
            signed_data,
            get_header,
        )
        return HttpResponse(data, status=status_code)
    return csrf_exempt(provider_view)
dataset/ETHPy150Open aldryncore/webservices/webservices/sync.py/provider_for_django/swapped operands of `%`