'Fill out and submit a registration form.
The form may be composed of basic registration fields, a data form,
an out-of-band link, or any combination thereof. Data forms and OOB
links can be checked for as so:
if iq.match(\'iq/register/form\'):
# do stuff with data form
# iq[\'register\'][\'form\'][\'fields\']
if iq.match(\'iq/register/oob\'):
# do stuff with OOB URL
# iq[\'register\'][\'oob\'][\'url\']
To get the list of basic registration fields, you can use:
iq[\'register\'][\'fields\']'

def register(self, iq):

    resp = self.Iq()
    resp['type'] = 'set'
    resp['register']['username'] = self.boundjid.user
    resp['register']['password'] = self.password
    try:
        resp.send(now=True)
        logging.info(('Account    created    for    %s!' % self.boundjid))
    except IqError as e:
        logging.error(('Could    not    register    account:    %s' % e.iq['error']['text']))
        self.disconnect()
    except IqTimeout:
        logging.error('No    response    from    server.')
        self.disconnect()
