Create and return a presence stanza with the current settings.

        :return: Presence stanza
        :rtype: :class:`aioxmpp.Presence`
426770
def make_stanza(self):
        
        stanza = aioxmpp.Presence()
        self._state.apply_to_stanza(stanza)
        stanza.status.update(self._status)
        return stanza
1056403
def reset(self, required=False):
        
        reset = self._ow.reset()
        if required and reset:
            raise OneWireError("No presence pulse found. Check devices and wiring.")
        return not reset
775496
def session(self):
        
        ret = self.session_class(
            client_id=self._client_id,
            client=self.client,
            auto_refresh_url=self.auto_refresh_url,
            auto_refresh_kwargs=self.auto_refresh_kwargs,
            scope=self.scope,
            state=self.state,
            blueprint=self,
            base_url=self.base_url,
            **self.kwargs
        )

        def token_updater(token):
            self.token = token

        ret.token_updater = token_updater
        return self.session_created(ret)
1338457
def get_snmp_service(self):
        
        return SnmpContextManager(self.enable_flow, self.disable_flow, self._snmp_parameters, self._logger)
167388
def get_user_presence(self, userid):
        '''  '''
        response, status_code = self.__pod__.Presence.get_v2_user_uid_presence(
            sessionToken=self.__session__,
            uid=userid
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
702051
def _create_identity(id_type=None, username=None, password=None, tenant_id=None,
            tenant_name=None, api_key=None, verify_ssl=None,
            return_context=False):
    
    if id_type:
        cls = _import_identity(id_type)
    else:
        cls = settings.get("identity_class")
    if not cls:
        raise exc.IdentityClassNotDefined("No identity class has "
                "been defined for the current environment.")
    if verify_ssl is None:
        verify_ssl = get_setting("verify_ssl")
    context = cls(username=username, password=password, tenant_id=tenant_id,
            tenant_name=tenant_name, api_key=api_key, verify_ssl=verify_ssl)
    if return_context:
        return context
    else:
        global identity
        identity = context
1100414
def set_unavailable(self):
        """"""
        show = PresenceShow.NONE
        self.set_presence(PresenceState(available=False, show=show))
997031
function create() {
  function app(stanza) { app.handle(stanza); }
  utils.merge(app, application);
  app._stack = [];
  app._filters = [];
  for (var i = 0; i < arguments.length; ++i) {
    app.use(arguments[i]);
  }
  return app;
}
881124
def create(self):
        
        self.service.create()

        # Set environment variables for immediate use
        predix.config.set_env_value(self.use_class, 'uri', self._get_uri())
        predix.config.set_env_value(self.use_class, 'zone_id',
                self._get_zone_id())
1030750
def get(self, sid):
        
        return SampleContext(
            self._version,
            assistant_sid=self._solution['assistant_sid'],
            task_sid=self._solution['task_sid'],
            sid=sid,
        )
865400
def service_present(name, service_type, description=None,
                    profile=None, **connection_args):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Service "{0}" already exists'.format(name)}

    # Check if service is already present
    role = __salt__['keystone.service_get'](name=name,
                                            profile=profile,
                                            **connection_args)

    if 'Error' not in role:
        return ret
    else:
        if __opts__.get('test'):
            ret['result'] = None
            ret['comment'] = 'Service "{0}" will be added'.format(name)
            return ret
        # Create service
        __salt__['keystone.service_create'](name, service_type,
                                            description,
                                            profile=profile,
                                            **connection_args)
        ret['comment'] = 'Service "{0}" has been added'.format(name)
        ret['changes']['Service'] = 'Created'

    return ret
273301
def tenant_present(name, description=None, enabled=True, profile=None,
                   **connection_args):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Tenant / project "{0}" already exists'.format(name)}

    _api_version(profile=profile, **connection_args)

    # Check if tenant is already present
    tenant = __salt__['keystone.tenant_get'](name=name,
                                             profile=profile,
                                             **connection_args)

    if 'Error' not in tenant:
        if tenant[name].get('description', None) != description:
            if __opts__.get('test'):
                ret['result'] = None
                ret['comment'] = 'Tenant / project "{0}" will be updated'.format(name)
                ret['changes']['Description'] = 'Will be updated'
                return ret
            __salt__['keystone.tenant_update'](name=name,
                                               description=description,
                                               enabled=enabled,
                                               profile=profile,
                                               **connection_args)
            ret['comment'] = 'Tenant / project "{0}" has been updated'.format(name)
            ret['changes']['Description'] = 'Updated'
        if tenant[name].get('enabled', None) != enabled:
            if __opts__.get('test'):
                ret['result'] = None
                ret['comment'] = 'Tenant / project "{0}" will be updated'.format(name)
                ret['changes']['Enabled'] = 'Will be {0}'.format(enabled)
                return ret
            __salt__['keystone.tenant_update'](name=name,
                                               description=description,
                                               enabled=enabled,
                                               profile=profile,
                                               **connection_args)
            ret['comment'] = 'Tenant / project "{0}" has been updated'.format(name)
            ret['changes']['Enabled'] = 'Now {0}'.format(enabled)
    else:
        if __opts__.get('test'):
            ret['result'] = None
            ret['comment'] = 'Tenant / project "{0}" will be added'.format(name)
            ret['changes']['Tenant'] = 'Will be created'
            return ret
        # Create tenant
        if _OS_IDENTITY_API_VERSION > 2:
            created = __salt__['keystone.project_create'](name=name, domain='default', description=description,
                                                          enabled=enabled, profile=profile, **connection_args)
        else:
            created = __salt__['keystone.tenant_create'](name=name, description=description, enabled=enabled,
                                                         profile=profile, **connection_args)
        ret['changes']['Tenant'] = 'Created' if created is True else 'Failed'
        ret['result'] = created
        ret['comment'] = 'Tenant / project "{0}" has been added'.format(name)
    return ret
564904
function(stanza)
    {
        var node = stanza.getElementsByTagName('query')[0].getAttribute('node');
        var attrs = {xmlns: Strophe.NS.DISCO_INFO};
        var i;
        if (node)
        {
            attrs.node = node;
        }
        var iqresult = this._buildIQResult(stanza, attrs);
        for (i=0; i<this._identities.length; i++)
        {
            attrs = {category: this._identities[i].category,
                         type    : this._identities[i].type};
            if (this._identities[i].name)
                attrs.name = this._identities[i].name;
            if (this._identities[i].lang)
                attrs['xml:lang'] = this._identities[i].lang;
            iqresult.c('identity', attrs).up();
        }
        for (i=0; i<this._features.length; i++)
        {
            iqresult.c('feature', {'var':this._features[i]}).up();
        }
        this._connection.send(iqresult.tree());
        return true;
    }
643264
function prepareRes(stanza) {
  var res = null;
  
  if (stanza.is('iq') && (stanza.attr('type') == 'get' || stanza.attr('type') == 'set')) {
    // TODO: When connected as a component, the from field needs to be set
    //       eplicitly (from = stanza.attrs.to).
    res = new xmpp.Stanza('iq', { id: stanza.attr('id'),
                                  to: stanza.attr('from'),
                                  type: 'result' })
  }
  // TODO: Prepare presence and message stanzas (which are optional to send)
  
  return res;
}
508378
def create(self):
        
        self._app = Flask(__name__)

        path = '/2015-03-31/functions/<function_name>/invocations'
        self._app.add_url_rule(path,
                               endpoint=path,
                               view_func=self._invoke_request_handler,
                               methods=['POST'],
                               provide_automatic_options=False)

        # setup request validation before Flask calls the view_func
        self._app.before_request(LocalLambdaInvokeService.validate_request)

        self._construct_error_handling()
829792
def container(self, node, elem, module, path):
        """"""
        nel, newm, path = self.sample_element(node, elem, module, path)
        if path is None:
            return
        if self.annots:
            pres = node.search_one("presence")
            if pres is not None:
                nel.append(etree.Comment(" presence: %s " % pres.arg))
        self.process_children(node, nel, newm, path)
767205
def get(self, sid):
        
        return DeploymentContext(
            self._version,
            service_sid=self._solution['service_sid'],
            environment_sid=self._solution['environment_sid'],
            sid=sid,
        )