Return a :class:`.node.UseConnected` context manager which does not
        modify the presence settings.

        The keyword arguments are passed to the :class:`.node.UseConnected`
        context manager constructor.

        .. versionadded:: 0.8
183694
def connected(self, *, presence=structs.PresenceState(False), **kwargs):
        
        return UseConnected(self, presence=presence, **kwargs)
641215
def context(self):
        
        ret = libxml2mod.xmlXPathParserGetContext(self._o)
        if ret is None:raise xpathError('xmlXPathParserGetContext() failed')
        __tmp = xpathContext(_obj=ret)
        return __tmp
475870
def _make_connect(module, args, kwargs):
    
    # pylint: disable-msg=W0142
    return functools.partial(module.connect, *args, **kwargs)
1060024
def context_loader(self, callback):
        
        if not callback or not callable(callback):
            raise Exception("Please pass in a callable that loads your context.")
        self.context_loader_callback = callback
        return callback
228808
private static boolean getSystemConnectivity(Context context) {
    try {
      ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
      if (cm == null) {
        return false;
      }

      NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
      return activeNetwork.isConnectedOrConnecting();
    } catch (Exception exception) {
      return false;
    }
  }
114586
def init_with_context(self, context):
        
        site_name = get_admin_site_name(context)

        self.children += [
            items.MenuItem(_('Dashboard'), reverse('{0}:index'.format(site_name))),
            items.Bookmarks(),
        ]

        for title, kwargs in get_application_groups():
            if kwargs.get('enabled', True):
                self.children.append(CmsModelList(title, **kwargs))

        self.children += [
            ReturnToSiteItem()
        ]
212621
def presence(presence=nil, status=nil, priority=nil)
      @config[:presence] = presence
      @config[:status]   = status
      @config[:priority] = priority

      status_message = Presence.new(presence, status, priority)
      @jabber.send!(status_message) if @jabber.connected?
    end
266989
async def create_connection(self):
        ''''''
        connector = self.proxy or self.loop
        return await connector.create_connection(
            self.session_factory, self.host, self.port, **self.kwargs)
526842
def batch_connect_template(context = {})
      context = context.to_h.symbolize_keys
      BatchConnect::Factory.build batch_connect_config(context[:template] || :basic).merge(context)
    end
694339
def myself(self):
        
        return self.context_class(
            router=self,
            context_id=mitogen.context_id,
            name='self',
        )
402367
def notConnectedNodes(self) -> Set[str]:
        
        return set(self.registry.keys()) - self.conns
1023169
def _wrap(self, meth, *args, **kwargs):
        
        if not self.connected:
            return self._connectSchedule(self._wrap, meth, *args, **kwargs)

        opres = meth(self, *args, **kwargs)
        return self.defer(opres)
1104612
def hooks_factory(identifier, configuration, context):
    
    manager = HookManager(identifier, configuration)
    manager.load_hooks(context)

    return manager
1300025
def set_conn(self, **kwargs):
        

        # log = logging.getLogger("%s.%s" % (self.log, inspect.stack()[0][3]))
        log.setLevel(kwargs.get('log_level',self.log_level))

        conn_name = kwargs.get("name")
        if not conn_name:
            raise NameError("a connection requires a 'name': %s" % kwargs)
        elif self.conns.get(conn_name):
            raise KeyError("connection '%s' has already been set" % conn_name)

        if not kwargs.get("active", True):
            log.warning("Connection '%s' is set as inactive" % conn_name)
            return
        conn_type = kwargs.get("conn_type")
        if not conn_type or conn_type not in self.conn_mapping.nested:
            err_msg = ["a connection requires a valid 'conn_type':\n",
                       "%s"]
            raise NameError("".join(err_msg) % (list(self.conn_mapping.nested)))
        log.info("Setting '%s' connection", conn_name)
        if conn_type == "triplestore":
            conn = make_tstore_conn(kwargs)
        else:
            conn = RdfwConnections[conn_type][kwargs['vendor']](**kwargs)
        self.conns[conn_name] = conn
        self.__is_initialized__ = True
557614
def get_context_data(self, **kwargs):
        
        context = super(FriendListView, self).get_context_data(**kwargs)

        friends = []
        for friend_list in self.social_friend_lists:
            fs = friend_list.existing_social_friends()
            for f in fs:
                friends.append(f)

        # Add friends to context
        context['friends'] = friends

        connected_providers = []
        for sa in self.social_auths:
            connected_providers.append(sa.provider)
        context['connected_providers'] = connected_providers

        return context
1002007
def acquire(self) -> Connection:
        '''
        '''
        assert not self._closed

        yield from self._condition.acquire()

        while True:
            if self.ready:
                connection = self.ready.pop()
                break
            elif len(self.busy) < self.max_connections:
                connection = self._connection_factory()
                break
            else:
                yield from self._condition.wait()

        self.busy.add(connection)
        self._condition.release()

        return connection
801286
def with_context(self, required_by):
        
        if not required_by:
            return self
        args = self.args + (required_by,)
        return ContextualVersionConflict(*args)