def connect(self, callback, *args, **kwargs):
if self.is_connected(callback):<EOL><INDENT>raise AttributeError('<STR_LIT>')<EOL><DEDENT>if self.hard_subscribers is None:<EOL><INDENT>self.hard_subscribers = []<EOL><DEDENT>self.hard_subscribers.append((callback, args, kwargs))<EOL>
Connects the event with the given callback.
When the signal is emitted, the callback is invoked.

.. note::

    The signal handler is stored with a hard reference, so you
    need to make sure to call :class:`disconnect()` if you want the
    handler
    to be garbage collected.

:type  callback: object
:param callback: The callback function.
:type  args: tuple
:param args: Optional arguments passed to the callback.
:type  kwargs: dict
:param kwargs: Optional keyword arguments passed to the callback.