'A wrapper for :meth:`send_raw()` for sending stanza objects.
May optionally block until an expected response is received.
:param data: The :class:`~sleekxmpp.xmlstream.stanzabase.ElementBase`
stanza to send on the stream.
:param mask: **DEPRECATED**
An XML string snippet matching the structure
of the expected response. Execution will block
in this thread until the response is received
or a timeout occurs.
:param int timeout: Time in seconds to wait for a response before
continuing. Defaults to :attr:`response_timeout`.
:param bool now: Indicates if the send queue should be skipped,
sending the stanza immediately. Useful mainly
for stream initialization stanzas.
Defaults to ``False``.
:param bool use_filters: Indicates if outgoing filters should be
applied to the given stanza data. Disabling
filters is useful when resending stanzas.
Defaults to ``True``.'

def send(self, data, mask=None, timeout=None, now=False, use_filters=True):

    if (timeout is None):
        timeout = self.response_timeout
    if hasattr(mask, u'xml'):
        mask = mask.xml
    if isinstance(data, ElementBase):
        if use_filters:
            for filter in self.__filters[u'out']:
                data = filter(data)
                if (data is None):
                    return
    if (mask is not None):
        log.warning(u'Use    of    send    mask    waiters    is    deprecated.')
        wait_for = Waiter((u'SendWait_%s' % self.new_id()), MatchXMLMask(mask))
        self.register_handler(wait_for)
    if isinstance(data, ElementBase):
        with self.send_queue_lock:
            if use_filters:
                for filter in self.__filters[u'out_sync']:
                    data = filter(data)
                    if (data is None):
                        return
            str_data = tostring(data.xml, xmlns=self.default_ns, stream=self, top_level=True)
            self.send_raw(str_data, now)
    else:
        self.send_raw(data, now)
    if (mask is not None):
        return wait_for.wait(timeout)
