human
I wrote the below code

    from geonode.utils import http_client
    if (request.method == 'POST'):
        layers = request.POST.getlist('layer')
        layers = Layer.objects.filter(alternate__in=list(layers))
        def layer_son(layer):
            return {'name': layer.alternate, 'service': layer.service_type, 'metadataURL': '', 'serviceURL': ''}
        readme = 'This    data    is    provided    by    GeoNode.\n\nContents:'
        def list_item(lyr):
            return ('%s    -    %s.*' % (lyr.title, lyr.name))
        readme = '\n'.join(([readme] + [list_item(l) for l in layers]))
        fake_map = {'map': {'readme': readme}, 'layers': [layer_son(lyr) for lyr in layers]}
        url = ('%srest/process/batchDownload/launch/' % ogc_server_settings.LOCATION)
        (resp, content) = http_client.request(url, 'POST', body=json.dumps(fake_map))
        return HttpResponse(content, status=resp.status)
    if (request.method == 'GET'):
        download_id = request.GET.get('id', None)
        if (download_id is None):
            return HttpResponse(status=404)
        url = ('%srest/process/batchDownload/status/%s' % (ogc_server_settings.LOCATION, download_id))
        (resp, content) = http_client.request(url, 'GET')
        return HttpResponse(content, status=resp.status)

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

def layer_batch_download(request):