'Retrieve the disco#info results from a given JID/node combination.
Info may be retrieved from both local resources and remote agents;
the local parameter indicates if the information should be gathered
by executing the local node handlers, or if a disco#info stanza
must be generated and sent.
If requesting items from a local JID/node, then only a DiscoInfo
stanza will be returned. Otherwise, an Iq stanza will be returned.
Arguments:
jid      -- Request info from this JID.
node     -- The particular node to query.
local    -- If true, then the query is for a JID/node
combination handled by this Sleek instance and
no stanzas need to be sent.
Otherwise, a disco stanza must be sent to the
remove JID to retrieve the info.
cached   -- If true, then look for the disco info data from
the local cache system. If no results are found,
send the query as usual. The self.use_cache
setting must be set to true for this option to
be useful. If set to false, then the cache will
be skipped, even if a result has already been
cached. Defaults to false.
ifrom    -- Specifiy the sender\'s JID.
block    -- If true, block and wait for the stanzas\' reply.
timeout  -- The time in seconds to block while waiting for
a reply. If None, then wait indefinitely. The
timeout value is only used when block=True.
callback -- Optional callback to execute when a reply is
received instead of blocking and waiting for
the reply.
timeout_callback -- Optional callback to execute when no result
has been received in timeout seconds.'

def get_info(self, jid=None, node=None, local=None, cached=None, **kwargs):

    if (local is None):
        if ((jid is not None) and (not isinstance(jid, JID))):
            jid = JID(jid)
            if self.xmpp.is_component:
                if (jid.domain == self.xmpp.boundjid.domain):
                    local = True
            elif (str(jid) == str(self.xmpp.boundjid)):
                local = True
            jid = jid.full
        elif (jid in (None, '')):
            local = True
    if local:
        log.debug(('Looking    up    local    disco#info    data    ' + 'for    %s,    node    %s.'), jid, node)
        info = self.api['get_info'](jid, node, kwargs.get('ifrom', None), kwargs)
        info = self._fix_default_info(info)
        return self._wrap(kwargs.get('ifrom', None), jid, info)
    if cached:
        log.debug(('Looking    up    cached    disco#info    data    ' + 'for    %s,    node    %s.'), jid, node)
        info = self.api['get_cached_info'](jid, node, kwargs.get('ifrom', None), kwargs)
        if (info is not None):
            return self._wrap(kwargs.get('ifrom', None), jid, info)
    iq = self.xmpp.Iq()
    iq['from'] = kwargs.get('ifrom', kwargs.get('dfrom', ''))
    iq['to'] = jid
    iq['type'] = 'get'
    iq['disco_info']['node'] = (node if node else '')
    return iq.send(timeout=kwargs.get('timeout', None), block=kwargs.get('block', True), callback=kwargs.get('callback', None), timeout_callback=kwargs.get('timeout_callback', None))
