def METHOD_NAME(self, data):
    """
    Extend every field to have the same number of items. Additionaly remove
    empty rows from the end.
    """
    max_length = 0
    for field in self.multivalue_fields:
        value = data.get(field, [])
        max_length = max(max_length, len(value))
    for field in self.multivalue_fields:
        value = data.get(field, [])
        data[field] = value + [''] * (max_length - len(value))  # None?
    # remove empty lines
    while True:
        rows = list(zip(*[data[f] for f in self.multivalue_fields]))
        if len(rows) == 0:
            break
        if not any(rows[-1]):
            for field in self.multivalue_fields:
                data[field].pop()
        else:
            break
    return data