'Instantiates and returns the i-th form instance in a formset.'

def _construct_form(self, i, **kwargs):

    defaults = {'auto_id': self.auto_id, 'prefix': self.add_prefix(i)}
    if (self.data or self.files):
        defaults['data'] = self.data
        defaults['files'] = self.files
    if self.initial:
        try:
            defaults['initial'] = self.initial[i]
        except IndexError:
            pass
    if (i >= self.initial_form_count()):
        defaults['empty_permitted'] = True
    defaults.update(kwargs)
    form = self.form(**defaults)
    self.add_fields(form, i)
    return form
