<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_form(self, form_data, widget_attrs=None, template=None):
 """Constructs, populates and returns a form."""

        form = self.form(data=form_data)
        form.template = template
        # Attach flow attribute to have access from flow forms (usually to call get_arg_or_attr())
        form.flow = self
        if widget_attrs is not None:
            set_form_widgets_attrs(form, widget_attrs)
        return form