Creates a connection for this instance for the given signal.
        
        :param      signal | <str>
                    slot   | <callable>
776770
def connect(self, signal, slot):
        
        super(XViewDispatch, self).connect(self, SIGNAL(signal), slot)
811324
def send(self, *sender, **kwargs):
        
        if len(sender) == 0:
            sender = None
        elif len(sender) > 1:
            raise TypeError('send() accepts only one positional argument, '
                            '%s given' % len(sender))
        else:
            sender = sender[0]

        if not self.receivers:
            return []

        rv = list()
        for receiver in self.receivers_for(sender):
            try:
                rv.append((receiver, receiver(sender, **kwargs)))
            except Exception:
                logger.exception('Error while dispatching signal "{}" '
                                 'to receiver'.format(self.name))
        return rv
706664
def _createConnection(self, connections):
        

        for c in connections:
            # Create GSSHAPY Connection object
            connection = Connection(slinkNumber=c['slinkNumber'],
                                    upSjuncNumber=c['upSjunc'],
                                    downSjuncNumber=c['downSjunc'])

            # Associate Connection with StormPipeNetworkFile
            connection.stormPipeNetworkFile = self
195442
def print_signals_and_slots(self):
        
        for i in xrange(self.metaObject().methodCount()):
             m = self.metaObject().method(i)
             if m.methodType() == QMetaMethod.MethodType.Signal:
                 print("SIGNAL: sig=", m.signature(), "hooked to nslots=", self.receivers(SIGNAL(m.signature())))
             elif m.methodType() == QMetaMethod.MethodType.Slot:
                 print("SLOT: sig=", m.signature())
1006527
def send_signal(signal, request, user, **kwargs):
    '''
    '''
    params = {
        'user_ip': request.remote_addr
    }
    params.update(kwargs)
    if user.is_authenticated:
        params['uid'] = user.id
    signal.send(request.url, **params)
229218
def connect(self, signal, **kwargs):
        """"""
        signal.connect(self, **kwargs)
        self.connections.append((signal, kwargs))
1270537
def signal_alias_exists(alias: str) -> bool:
        
        if SignalDispatcher.signals.get(alias):
            return True

        return False
449083
def connect_signals(self):
        
        for task in self:
            dispatcher.connect(self.on_ok, signal=task.S_OK, sender=task)
149403
def get(self, signal=None):
        
        return self.__app.signals.get(signal, self._plugin)
1177354
def get(self, signal=None, plugin=None):
        
        if plugin is not None:
            if signal is None:
                signals_list = {}
                for key in self.signals.keys():
                    if self.signals[key].plugin == plugin:
                        signals_list[key] = self.signals[key]
                return signals_list
            else:
                if signal in self.signals.keys():
                    if self.signals[signal].plugin == plugin:
                        return self.signals[signal]
                    else:
                        return None
                else:
                    return None
        else:
            if signal is None:
                return self.signals
            else:
                if signal in self.signals.keys():
                    return self.signals[signal]
                else:
                    return None
1371694
def new_signal(celf, path, iface, name) :
        ""
        result = dbus.dbus_message_new_signal(path.encode(), iface.encode(), name.encode())
        if result == None :
            raise CallFailed("dbus_message_new_signal")
        #end if
        return \
            celf(result)
1042858
def make_connection(self):
        """"""
        if self._created_connections[self._pattern_idx] >= self.max_connections_per_pattern:
            raise ConnectionError("Too many connections")
        self._created_connections[self._pattern_idx] += 1
        conn = self.connection_class(**self.patterns[self._pattern_idx])
        conn._pattern_idx = self._pattern_idx
        return conn
63079
def setup_standalone_signals(instance):
    
    window = instance.get_widget('config-window')
    window.connect('delete-event', Gtk.main_quit)

    # We need to block the execution of the already associated
    # callback before connecting the new handler.
    button = instance.get_widget('button1')
    button.handler_block_by_func(instance.gtk_widget_destroy)
    button.connect('clicked', Gtk.main_quit)

    return instance
470743
def emit(self, signalName, *args, **kwargs):
        
        assert signalName in self, "%s is not a registered signal" % signalName
        self[signalName].emit(*args, **kwargs)
598797
def send_connect_signal(self, request, user, profile, client):
        
        signals.connect.send(sender=profile.__class__, user=user, profile=profile,
            client=client, request=request)
1208802
def signal(signal=None):
    '''
    
    '''
    valid_signals = ('start', 'reopen', 'stop', 'quit', 'reload')

    if signal not in valid_signals:
        return

    # Make sure you use the right arguments
    if signal == "start":
        arguments = ''
    else:
        arguments = ' -s {0}'.format(signal)
    cmd = __detect_os() + arguments
    out = __salt__['cmd.run_all'](cmd)

    # A non-zero return code means fail
    if out['retcode'] and out['stderr']:
        ret = out['stderr'].strip()
    # 'nginxctl configtest' returns 'Syntax OK' to stderr
    elif out['stderr']:
        ret = out['stderr'].strip()
    elif out['stdout']:
        ret = out['stdout'].strip()
    # No output for something like: nginxctl graceful
    else:
        ret = 'Command: "{0}" completed successfully!'.format(cmd)
    return ret
691622
def _do_connection(self, wgt, sig, func):
        
        #new style  (we use this)
        #self.btn_name.clicked.connect(self.on_btn_name_clicked)
        #old style
        #self.connect(self.btn_name, SIGNAL('clicked()'), self.on_btn_name_clicked)

        if hasattr(self, wgt):
            wgtobj = getattr(self, wgt)
            if hasattr(wgtobj, sig):
                sigobj = getattr(wgtobj, sig)
                if isinstance(sigobj, Signal):
                    sigobj.connect(func)
                    return 0
        return 1