human
I wrote the below code

    def wrap(request, *args, **kwargs):
        'Wrap'
        user = request.user.profile
        if ('massform' in request.POST):
            for key in request.POST:
                if ('mass-object' in key):
                    try:
                        query = ((Q(object_type='treeio.documents.models.Document') | Q(object_type='treeio.documents.models.File')) | Q(object_type='treeio.documents.models.WebLink'))
                        objects = Object.filter_by_request(request, Object.objects.filter(query))
                        object = objects.get(pk=request.POST[key])
                        form = MassActionForm(user, request.POST, instance=object)
                        if (form.is_valid() and user.has_permission(object, mode='w')):
                            form.save()
                    except Exception:
                        pass
                if ('mass-file' in key):
                    try:
                        file = File.objects.get(pk=request.POST[key])
                        form = MassActionForm(user, request.POST, instance=file)
                        if (form.is_valid() and user.has_permission(file, mode='w')):
                            form.save()
                    except Exception:
                        pass
                if ('mass-weblink' in key):
                    try:
                        link = WebLink.objects.get(pk=request.POST[key])
                        form = MassActionForm(user, request.POST, instance=link)
                        if (form.is_valid() and user.has_permission(link, mode='w')):
                            form.save()
                    except Exception:
                        pass
                if ('mass-document' in key):
                    try:
                        document = Document.objects.get(pk=request.POST[key])
                        form = MassActionForm(user, request.POST, instance=document)
                        if (form.is_valid() and user.has_permission(document, mode='w')):
                           ...

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

def _process_mass_form(f):