human
Complete this python program:
def formset_initial_value_extractor(request, parameter_names):
assistant
#Here is the Python code you requested.

    """Builds a list of data that formsets should use by extending some fields to every object,
    whilst others are assumed to be received in order.
    Formsets should receive data that looks like this: [{\param1\: <something>,...}, ...].
    The formsets should then handle construction on their own.
    """
    def _intial_value_extractor(request):
        if (not submitted):
            return []
        data = []
        for param in submitted:
            i = 0
            for val in request.POST.getlist(param):
                if (len(data) == i):
                    data.append({})
                data[i][param] = val
                i += 1
        for kwargs in data:
            for recurrent in recurring:
                kwargs[recurrent] = request.POST.get(recurrent)
        initial_data = data
        return {'initial': initial_data}
    return _intial_value_extractor