def get_formset(self, form, name):
        """
        Get an instance of the formset.
        """
        kwargs = self.get_kwargs(form, name)
        formset_class = self.get_formset_class(form, name)
        formset = formset_class(
            form.data if form.is_bound else None,
            form.files if form.is_bound else None,
            **kwargs)
        return formset
Get an instance of the formset.