Perform the initial connection of the widget

        the default implementation will connect to the widgets signal
        based on self.signal_name
777442
def connect_widget(self):
        
        if self.signal_name is not None:
            # None for read only widgets
            sid = self.widget.connect(self.signal_name, self.widget_changed)
            self.connections.append(sid)
229218
def connect(self, signal, **kwargs):
        """"""
        signal.connect(self, **kwargs)
        self.connections.append((signal, kwargs))
770213
def connect(self, signal, slot):
        
        if self.isConnected(signal, slot):
            return False

        callback = Callback(slot)
        self._callbacks.setdefault(signal, [])
        self._callbacks[signal].append(callback)
        return True
369436
def init_app(self, app):
        """"""
        self.init_config(app)
        app.extensions['invenio-github'] = self

        @app.before_first_request
        def connect_signals():
            """Connect OAuthClient signals."""
            from invenio_oauthclient.models import RemoteAccount
            from invenio_oauthclient.signals import account_setup_committed

            from .api import GitHubAPI
            from .handlers import account_post_init

            account_setup_committed.connect(
                account_post_init,
                sender=GitHubAPI.remote._get_current_object()
            )

            @event.listens_for(RemoteAccount, 'before_delete')
            def receive_before_delete(mapper, connection, target):
                """Listen for the 'before_delete' event."""
557330
def on_start(self, host, port, channel, nickname, password):
        
        self.client = WebSocketIRCClient(host, port, channel, nickname,
                                         password, self)
        self.spawn(self.client.start)
1024066
def init_widget(self):
        
        if not self.toast:
            return
        super(AndroidToast, self).init_widget()

        d = self.declaration
        if not self.made_toast:
            #: Set it to LONG
            self.toast.setDuration(1)
        if d.gravity:
            self.set_gravity(d.gravity)
        if d.show:
            self.set_show(d.show)
754578
def init_widget(self):
        
        super(AndroidCompoundButton, self).init_widget()
        w = self.widget
        w.setOnCheckedChangeListener(w.getId())
        w.onCheckedChanged.connect(self.on_checked)
474724
def init_widget(self):
        
        super(AndroidViewAnimator, self).init_widget()
        d = self.declaration
        if d.animate_first_view:
            self.set_animate_first_view(d.animate_first_view)
        if d.displayed_child:
            self.set_displayed_child(d.displayed_child)
147427
def init_widget(self):
        
        super(AndroidTextView, self).init_widget()
        d = self.declaration
        w = self.widget
        if d.input_type:
            self.set_input_type(d.input_type)
            w.addTextChangedListener(w.getId())
            w.onTextChanged.connect(self.on_text_changed)
1009988
def connect(self, **kwargs):
        
        self.app = self._app.connect(**kwargs)
        try:
            self._top_window = self.app.top_window().wrapper_object()
            self.set_foreground()
        except RuntimeError:
            self._top_window = None
1489
def begin(self):
        

        resp = ws.ws2811_init(self._leds)
        if resp != 0:
            str_resp = ws.ws2811_get_return_t_str(resp)
            raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, str_resp))
539617
def initialize_connection(self):  # noqa: E501 pylint:disable=too-many-statements, too-many-branches
        """"""
        tries = self.tries

        if self.socket is not None:
            self.socket.close()
            self.socket = None

        # Make sure nobody is blocking.
        for callback in self._request_callbacks.values():
            callback['event'].set()

        self.app_namespaces = []
        self.destination_id = None
        self.session_id = None
        self._request_id = 0
        self._request_callbacks = {}
        self._open_channels = []

        self.connecting = True
        retry_log_fun = self.logger.error

        # Dict keeping track of individual retry delay for each named service
        retries = {}

        def mdns_backoff(service, retry):
            """Exponentional backoff for service name mdns lookups."""
            now = time.time()
            retry['next_retry'] = now + retry['delay']
            retry['delay'] = min(retry['delay']*2, 300)
            retries[service] = retry

        while not self.stop.is_set() and (tries is None or tries > 0):  # noqa: E501 pylint:disable=too-many-nested-blocks
            # Prune retries dict
            retries = {key: retries[key] for key in self.services if (
                key is not None and key in retries)}

            for service in self.services.copy():
                now = time.time()
                retry = retries.get(
                    service, {'delay': self.retry_wait, 'next_retry': now})
                # If we're connecting to a named service, check if it's time
                if service and now < retry['next_retry']:
                    continue
                try:
                    self.socket = new_socket()
                    self.socket.settimeout(self.timeout)
                    self._report_connection_status(
                        ConnectionStatus(CONNECTION_STATUS_CONNECTING,
                                         NetworkAddress(self.host, self.port)))
                    # Resolve the service name. If service is None, we're
                    # connecting directly to a host name or IP-address
                    if service:
                        host = None
                        port = None
                        service_info = get_info_from_service(service,
                                                             self.zconf)
                        host, port = get_host_from_service_info(service_info)
                        if host and port:
                            try:
                                self.fn = service_info.properties[b'fn']\
                                    .decode('utf-8')
                            except (AttributeError, KeyError, UnicodeError):
                                pass
                            self.logger.debug(
                                "[%s:%s] Resolved service %s to %s:%s",
                                self.fn or self.host, self.port, service, host,
                                port)
                            self.host = host
                            self.port = port
                        else:
                            self.logger.debug(
                                "[%s:%s] Failed to resolve service %s",
                                self.fn or self.host, self.port, service)
                            self._report_connection_status(
                                ConnectionStatus(
                                    CONNECTION_STATUS_FAILED_RESOLVE,
                                    NetworkAddress(service, None)))
                            mdns_backoff(service, retry)
                            # If zeroconf fails to receive the necessary data,
                            # try next service
                            continue

                    self.logger.debug("[%s:%s] Connecting to %s:%s",
                                      self.fn or self.host, self.port,
                                      self.host, self.port)
                    self.socket.connect((self.host, self.port))
                    self.socket = ssl.wrap_socket(self.socket)
                    self.connecting = False
                    self._force_recon = False
                    self._report_connection_status(
                        ConnectionStatus(CONNECTION_STATUS_CONNECTED,
                                         NetworkAddress(self.host, self.port)))
                    self.receiver_controller.update_status()
                    self.heartbeat_controller.ping()
                    self.heartbeat_controller.reset()

                    self.logger.debug("[%s:%s] Connected!",
                                      self.fn or self.host, self.port)
                    return
                except OSError as err:
                    self.connecting = True
                    if self.stop.is_set():
                        self.logger.error(
                            "[%s:%s] Failed to connect: %s. "
                            "aborting due to stop signal.",
                            self.fn or self.host, self.port, err)
                        raise ChromecastConnectionError("Failed to connect")

                    self._report_connection_status(
                        ConnectionStatus(CONNECTION_STATUS_FAILED,
                                         NetworkAddress(self.host, self.port)))
                    if service is not None:
                        retry_log_fun(
                            "[%s:%s] Failed to connect to service %s"
                            ", retrying in %.1fs",
                            self.fn or self.host, self.port,
                            service, retry['delay'])
                        mdns_backoff(service, retry)
                    else:
                        retry_log_fun(
                            "[%s:%s] Failed to connect, retrying in %.1fs",
                            self.fn or self.host, self.port, self.retry_wait)
                    retry_log_fun = self.logger.debug

            # Only sleep if we have another retry remaining
            if tries is None or tries > 1:
                self.logger.debug(
                    "[%s:%s] Not connected, sleeping for %.1fs. Services: %s",
                    self.fn or self.host, self.port,
                    self.retry_wait, self.services)
                time.sleep(self.retry_wait)

            if tries:
                tries -= 1

        self.stop.set()
        self.logger.error("[%s:%s] Failed to connect. No retries.",
                          self.fn or self.host, self.port)
        raise ChromecastConnectionError("Failed to connect")
1019370
def init_widget(self):
        
        w = self.dialog
        # Listen for events
        w.setOnDismissListener(w.getId())
        w.onDismiss.connect(self.on_dismiss)
        w.setOnCancelListener(w.getId())
        w.onCancel.connect(self.on_cancel)
        super(AndroidDialog, self).init_widget()
661138
def connect(self, callback, ref=False, position='first',
                before=None, after=None):
        
        self._connect_emitters(True)
        return EventEmitter.connect(self, callback, ref, position,
                                    before, after)
598797
def send_connect_signal(self, request, user, profile, client):
        
        signals.connect.send(sender=profile.__class__, user=user, profile=profile,
            client=client, request=request)
828679
def setup_prjs_signals(self, ):
        
        log.debug("Setting up projects page signals.")
        self.prjs_prj_view_pb.clicked.connect(self.prjs_view_prj)
        self.prjs_prj_create_pb.clicked.connect(self.prjs_create_prj)
462393
def connect_signals(self, target):
        
        if self.connected:
            raise RuntimeError("GtkBuilder can only connect signals once")
        self.builder.connect_signals(target)
        self.connected = True