'Create and configure a new pubsub node.
A server MAY use a different name for the node than the one provided,
so be sure to check the result stanza for a server assigned name.
If no configuration form is provided, the node will be created using
the server\'s default configuration. To get the default configuration
use get_node_config().
Arguments:
jid      -- The JID of the pubsub service.
node     -- Optional name of the node to create. If no name is
provided, the server MAY generate a node ID for you.
The server can also assign a different name than the
one you provide; check the result stanza to see if
the server assigned a name.
config   -- Optional XEP-0004 data form of configuration settings.
ntype    -- The type of node to create. Servers typically default
to using \'leaf\' if no type is provided.
ifrom    -- Specify the sender\'s JID.
block    -- Specify if the send call will block until a response
is received, or a timeout occurs. Defaults to True.
timeout  -- The length of time (in seconds) to wait for a response
before exiting the send call if blocking is used.
Defaults to sleekxmpp.xmlstream.RESPONSE_TIMEOUT
callback -- Optional reference to a stream handler function. Will
be executed when a reply stanza is received.'

def create_node(self, jid, node, config=None, ntype=None, ifrom=None, block=True, callback=None, timeout=None):

    iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='set')
    iq['pubsub']['create']['node'] = node
    if (config is not None):
        form_type = 'http://jabber.org/protocol/pubsub#node_config'
        if ('FORM_TYPE' in config['fields']):
            config.field['FORM_TYPE']['value'] = form_type
        else:
            config.add_field(var='FORM_TYPE', ftype='hidden', value=form_type)
        if ntype:
            if ('pubsub#node_type' in config['fields']):
                config.field['pubsub#node_type']['value'] = ntype
            else:
                config.add_field(var='pubsub#node_type', value=ntype)
        iq['pubsub']['configure'].append(config)
    return iq.send(block=block, callback=callback, timeout=timeout)
