establish xbahn connection and store on click context
510511
def connect(self, ctx):

        

        if hasattr(ctx,"conn") or "host" not in ctx.params:
            return

        ctx.conn = conn = connect(ctx.params["host"])
        lnk = link.Link()
        lnk.wire("main", receive=conn, send=conn)
        ctx.client = api.Client(link=lnk)
        ctx.widget = ClientWidget(ctx.client, "engineer")
437902
protected void activate(ComponentContext compContext) {
        BundleContext ctx = compContext.getBundleContext();
        mDelayedMBeanActivator = new DelayedMBeanActivator(ctx);
        pipeline.insert(mDelayedMBeanActivator);
        try {
            mbeanTracker = new ServiceTracker<Object, ServiceReference<?>>(ctx, ctx.createFilter("(jmx.objectname=*)"), this);
            mbeanTracker.open(true);
        } catch (InvalidSyntaxException ise) {

        }
    }
636242
def connect_async(self, conn_id, connection_string, callback):
        """"""

        future = self._loop.launch_coroutine(self._adapter.connect(conn_id, connection_string))
        future.add_done_callback(lambda x: self._callback_future(conn_id, x, callback))
491527
def Connect(self):
    ''' '''
    device_path = self.path

    if device_path not in mockobject.objects:
        raise dbus.exceptions.DBusException('No such device.',
                                            name='org.bluez.Error.NoSuchDevice')

    device = mockobject.objects[device_path]

    device.props[AUDIO_IFACE]['State'] = dbus.String("connected",
                                                     variant_level=1)
    device.EmitSignal(AUDIO_IFACE, 'PropertyChanged', 'sv', [
        'State', dbus.String("connected", variant_level=1),
    ])

    device.props[DEVICE_IFACE]['Connected'] = dbus.Boolean(True,
                                                           variant_level=1)
    device.EmitSignal(DEVICE_IFACE, 'PropertyChanged', 'sv', [
        'Connected', dbus.Boolean(True, variant_level=1),
    ])
282354
function Global(transport, fastPathTransport) {
	this.transport = transport;
	this.fastPathTransport = fastPathTransport;
	// must be init via connect event
	this.userId = 0;
	this.serverCapabilities = [];
	this.clientCapabilities = [];
}
597071
function() {
        listenerKeys_.push(
          olEventsListen(map, 'singleclick', handleMapClick_)
        );
        const queryOptions = /** @type {import('ngeo/query/MapQuerent.js').QueryOptions} */ (
          $injector.has('ngeoQueryOptions') ? $injector.get('ngeoQueryOptions') : {}
        );
        if (queryOptions.cursorHover) {
          listenerKeys_.push(
            olEventsListen(map, 'pointermove', handlePointerMove_)
          );
        }
      }
146151
def connect(self, interface, event, handler):
        """"""
        object_path = self.object_path
        return self.bus.connect(interface, event, object_path, handler)
521331
def make_connector(self, app=None, bind=None):
        """"""
        return _EngineConnector(self, self.get_app(app), bind)
617894
def _prepare_connection(**nxos_api_kwargs):
    '''
    
    '''
    nxos_api_kwargs = clean_kwargs(**nxos_api_kwargs)
    init_kwargs = {}
    # Clean up any arguments that are not required
    for karg, warg in six.iteritems(nxos_api_kwargs):
        if karg in RPC_INIT_KWARGS:
            init_kwargs[karg] = warg
    if 'host' not in init_kwargs:
        init_kwargs['host'] = 'localhost'
    if 'transport' not in init_kwargs:
        init_kwargs['transport'] = 'https'
    if 'port' not in init_kwargs:
        init_kwargs['port'] = 80 if init_kwargs['transport'] == 'http' else 443
    verify = init_kwargs.get('verify', True)
    if isinstance(verify, bool):
        init_kwargs['verify_ssl'] = verify
    else:
        init_kwargs['ca_bundle'] = verify
    if 'rpc_version' not in init_kwargs:
        init_kwargs['rpc_version'] = '2.0'
    if 'timeout' not in init_kwargs:
        init_kwargs['timeout'] = 60
    return init_kwargs
897420
private void updateConnectionDetails() {
        Stage stage = (Stage)platformLabel.getScene().getWindow();

        connectedLabel.setText(connected ? "YES" : "NO");
        remoteInfo.ifPresent(remote -> {
            remoteNameLabel.setText(remote.getName());
            versionLabel.setText(remote.getMajorVersion() + "." + remote.getMinorVersion());
            platformLabel.setText(remote.getPlatform().getDescription());
            stage.setTitle("Connected to " + remote.getName());
        });

        if (!connected) {
            stage.setTitle("Disconnected [" + remoteControl.getConnector().getConnectionName() + "]");
            menuLoadLabel.setText("NO");
            versionLabel.setText("");
            remoteNameLabel.setText("");
        }
    }
929855
private void triggerTransportEstablished(TransportCandidate local, TransportCandidate remote) throws NotConnectedException, InterruptedException {
        List<JingleListener> listeners = getListenersList();
        for (JingleListener li : listeners) {
            if (li instanceof JingleTransportListener) {
                JingleTransportListener mli = (JingleTransportListener) li;
                LOGGER.fine("triggerTransportEstablished " + local.getLocalIp() + ":" + local.getPort() + " <-> "
                        + remote.getIp() + ":" + remote.getPort());
                mli.transportEstablished(local, remote);
            }
        }
    }
595606
def connect(token, protocol=RtmProtocol, factory=WebSocketClientFactory, factory_kwargs=None, api_url=None, debug=False):
	
	if factory_kwargs is None:
		factory_kwargs = dict()

	metadata = request_session(token, api_url)
	wsfactory = factory(metadata.url, **factory_kwargs)
	if debug:
		warnings.warn('debug=True has been deprecated in autobahn 0.14.0')

	wsfactory.protocol = lambda *a,**k: protocol(*a,**k)._seedMetadata(metadata)
	connection = connectWS(wsfactory)
	return connection
1240517
def connect_wrapper(context_or_world):
    
    # Create driver if it is not already created
    if context_or_world.driver_wrapper.driver:
        context_or_world.driver = context_or_world.driver_wrapper.driver
    else:
        context_or_world.driver = context_or_world.driver_wrapper.connect()

    # Copy app_strings object
    context_or_world.app_strings = context_or_world.driver_wrapper.app_strings
59047
function Connection(options) {
	
	if (!(this instanceof Connection)){
		return new Connection(options);
	}
	
	
	this.prefixCounter = 0;
	this.serverMessages = {};
	this._options = {
		username: options.username || options.user || '',
		password: options.password || '',
		host: options.host || 'localhost',
		port: options.port || 143,
		secure: options.secure === true ? { // secure = true means default behavior
			rejectUnauthorized: false // Force pre-node-0.9.2 behavior
		} : (options.secure || false),
		timeout: options.timeout || 10000, // connection timeout in msecs
		xoauth: options.xoauth,
		xoauth2: options.xoauth2
	};
	
	this._messages = {};
	this._messages = {};
	
	if (options.debug===true){
		this.debug = function(msg){
			console.log(msg);
		}
	}
	
		
	if (options.chainDebug===true){
		this.chainDebug = function(msg){
			console.log(msg);
		}
	}
	
	this.socket = null;
	
	this._messages_prefix_key={};
	this._messages_key_prefix={};
	this._messages={};
	
	
	this._msg_buffer = '';
	this._resetChainCommands();
}
1150835
def attach(self, gui, name=None):
        """"""

        # Disable keyboard pan so that we can use arrows as global shortcuts
        # in the GUI.
        self.panzoom.enable_keyboard_pan = False

        gui.add_view(self)
        self.gui = gui

        # Set the view state.
        self.set_state(gui.state.get_view_state(self))

        # Call on_select() asynchronously after a delay, and set a busy
        # cursor.
        self.async_caller = AsyncCaller(delay=self._callback_delay)

        @gui.connect_
        def on_select(cluster_ids, **kwargs):
            # Call this function after a delay unless there is another
            # cluster selection in the meantime.
            @self.async_caller.set
            def update_view():
                with busy_cursor():
                    self.on_select(cluster_ids, **kwargs)

        self.actions = Actions(gui,
                               name=name or self.__class__.__name__,
                               menu=self.__class__.__name__,
                               default_shortcuts=self.shortcuts)

        # Update the GUI status message when the `self.set_status()` method
        # is called, i.e. when the `status` event is raised by the VisPy
        # view.
        @self.connect
        def on_status(e):
            gui.status_message = e.message

        # Save the view state in the GUI state.
        @gui.connect_
        def on_close():
            gui.state.update_view_state(self, self.state)
            # NOTE: create_gui() already saves the state, but the event
            # is registered *before* we add all views.
            gui.state.save()

        self.show()
1109873
function Connection (remote, options) {
  EventEmitter.call(this);

  if (remote[remote.length - 1] === '/') {
    remote = remote.substr(0, remote.length - 1);
  }

  this._remote = remote;
  this._retry = options.retry || 3;
  this._options = options || {};
  this._request_internal = createInternalConnection(options.mode);
}
599891
function (ref, rootEl) {
  var routes = ref.routes;
  var debug = ref.debug;

  // load the routes
  if (routes) { store.loadRoutes(routes); }

  // enable console tools when debug enabled.
  if (debug === true) {
    window.router = store;
    subscribe(function (state, action) { return console.log("action", action); });
  }

  return connect(Container);
}