<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def connect(self, receiver, sender):
        '''
        Connects a signal to a receiver function

        :param receiver:
            The callback function which will be connected to this signal

        :param sender:
            Specifies a particular sender to receive signals from.
            Used to limit the receiver function to signal from particular sender types
        '''
        logger.info('Signal connected: {}'.format(receiver))
        ''' connect a receiver to a sender for signaling '''
        assert callable(receiver)
        receiver_id = _make_id(receiver)
        sender_id = _make_id(sender)
        r = ref
        if hasattr(receiver, '__self__') and hasattr(receiver, '__func__'):
            r = WeakMethod

        receiver = r(receiver)

        self.receivers.setdefault((receiver_id, sender_id), receiver)