def get_form(self, form_type = "<STR_LIT>"):
if self.form:<EOL><INDENT>if self.form.type != form_type:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return self.form<EOL><DEDENT>form = Form(form_type, instructions = self.instructions)<EOL>form.add_field("<STR_LIT>", [u"<STR_LIT>"], "<STR_LIT>")<EOL>for field in legacy_fields:<EOL><INDENT>field_type, field_label = legacy_fields[field]<EOL>value = getattr(self, field)<EOL>if value is None:<EOL><INDENT>continue<EOL><DEDENT>if form_type == "<STR_LIT>":<EOL><INDENT>if not value:<EOL><INDENT>value = None<EOL><DEDENT>form.add_field(name = field, field_type = field_type, label = field_label,<EOL>value = value, required = True)<EOL><DEDENT>else:<EOL><INDENT>form.add_field(name = field, value = value)<EOL><DEDENT><DEDENT>return form<EOL>
Return Data Form for the `Register` object.

        Convert legacy fields to a data form if `self.form` is `None`, return `self.form` otherwise.

        :Parameters:
            - `form_type`: If "form", then a form to fill-in should be
              returned. If "sumbit", then a form with submitted data.
        :Types:
            - `form_type`: `unicode`

        :return: `self.form` or a form created from the legacy fields
        :returntype: `pyxmpp.jabber.dataforms.Form`