Call this for setting hot_standby and weight together because
 the CLI is pretty weird and it accepts these params in a very
 particular way and they cannot even be reset unless proper
 order is followed
772137
def hs_weight(hs, wt)
      if hs != hot_standby && hot_standby == default_hot_standby
        self.lweight = wt unless weight == wt
        self.lhot_standby = hs
      elsif hs != hot_standby && hot_standby != default_hot_standby
        self.lhot_standby = hs
        self.lweight = wt unless weight == wt
      elsif wt != weight && weight == default_weight
        self.lweight = wt
      elsif wt != weight && weight != default_weight
        self.lweight = wt
      end
      set_args_keys_default
    end
691176
def set_config_parameter(self, param, value):
        '''

        '''
        with self._mutex:
            if self._obj.set_configuration(param, value) != RTC.RTC_OK:
                raise exceptions.FailedToSetConfigurationError(param, value)
            # Force a reparse of the configuration
            self._configuration = None
1063212
function() {
                this.aliases.blockHelperMissing = 'helpers.blockHelperMissing';

                // We're being a bit cheeky and reusing the options value from the prior exec
                var params = [this.contextName(0)];
                this.setupParams('', 0, params, true);

                this.flushInline();

                var current = this.topStack();
                params.splice(1, 0, current);

                this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
            }
14298
def start_accepting_passive_svc_checks(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if not self.my_conf.accept_passive_service_checks:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            self.my_conf.accept_passive_service_checks = True
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
1246801
def drop kwargs={}
      force = kwargs.arg :force, false

      cmd = 'aptly snapshot drop'
      cmd += ' -force' if force
      cmd += " #{@name.quote}"

      Aptly::runcmd cmd
    end
345803
def configure
      @web_server.mount('/alive', Alive)
      @web_server.mount('/tasks/new', NewTask, self)
      @web_server.mount('/shutdown', Shutdown)
      @web_server.mount('/response_from_device', ResponseFromDevice, self)
      @web_server.mount('/auto_update_pid', AutoUpdatePID, self)
    end
914398
def configure(options, cfg)
      cfg = super(options, cfg)
      cfg[:offline_queueing] = options[:offline_queueing]
      cfg[:filter_params] = options[:filter_params]
      cfg
    end
535063
def _set_dhw(self, status="Scheduled", mode=None, next_time=None):
        
        data = {"Status": status,
                "Mode": mode,
                "NextTime": next_time,
                "SpecialModes": None,
                "HeatSetpoint": None,
                "CoolSetpoint": None}

        self._populate_full_data()
        dhw_zone = self._get_dhw_zone()
        if dhw_zone is None:
            raise Exception('No DHW zone reported from API')
        url = (self.hostname + "/WebAPI/api/devices"
               "/%s/thermostat/changeableValues" % dhw_zone)

        response = self._do_request('put', url, json.dumps(data))

        task_id = self._get_task_id(response)

        while self._get_task_status(task_id) != 'Succeeded':
            time.sleep(1)
1260828
def set_default_init_cli_cmds(self):
        
        init_cli_cmds = []
        init_cli_cmds.append("set --retcode true")
        init_cli_cmds.append("echo off")
        init_cli_cmds.append("set --vt100 off")

        #set dut name as variable
        init_cli_cmds.append('set dut "'+self.name+'"')
        init_cli_cmds.append(['set testcase "' + self.testcase + '"', True])
        return init_cli_cmds
691931
def reset!
      Putio::Configurable.keys.each do |key|
        public_send("#{key}=".to_sym, Putio::Defaults.options[key])
      end
      self
    end
541676
function set(appName, limits, callback) {
    if (!isObject(limits)) {
      return callback(new Error('To set a variable pass an object'));
    }

    var keyValues = {};

    if (limits.hasOwnProperty('memory')) {
      keyValues.memory = limits.memory;
    }

    if (limits.hasOwnProperty('cpu')) {
      keyValues.cpu = limits.cpu;
    }

    if (Object.keys(keyValues).length === 0) {
      return callback(new Error('Only cpu and memory limits are valid'));
    }

    commons.post(format('/%s/apps/%s/config/', deis.version, appName), keyValues,
        function onSetResponse(err, result) {
          callback(err, result ? extractLimits(result) : null);
        });
  }
57356
def set_params_value(self, *params):
        
        if len(params) != len(self.parameters):
            raise Exception("parameter error")
        temp = self.parameters
        self.parameters = []
        for i in range(len(params)):
            self.parameters.append(Parameter(temp[i]['name'], temp[i]['type']))
            self.parameters[i].set_value(params[i])
873992
def setbridgeprio(self, prio):
        
        _runshell([brctlexe, 'setbridgeprio', self.name, str(prio)],
            "Could not set bridge priority in %s." % self.name)
1057635
def set_maintenance_mode(value):
    

    # If maintenance mode is defined in settings, it can't be changed.
    if settings.MAINTENANCE_MODE is not None:
        raise ImproperlyConfigured(
            'Maintenance mode cannot be set dynamically '
            'if defined in settings.')

    if not isinstance(value, bool):
        raise TypeError('value argument type is not boolean')

    backend = get_maintenance_mode_backend()
    backend.set_value(value)
1345537
function(params){
		process.nextTick(function(){
			var strippedName = params.name.replace(/-/g, "");
			if(!params.name){
				log("startup", "Name not passed correctly to daemon module");
				process.exit();
			}
			daemon = daemonize.setup({
	    		main: "../../server.js",
	    		name: strippedName,
	    		pidfile: "/var/run/" + strippedName + ".pid",
	    		cwd: process.cwd(),
	    		silent: true
			});
			if(process.argv[0].endsWith("sudo") && process.argv[1].endsWith("node")) { var i = 3 }
			else if (process.argv[0].endsWith("sudo") && !process.argv[1].endsWith("node")) { var i = 2 }
			else if (process.argv[0].endsWith("node")) { var i = 2 }
			else { var i = 1 }
			if((((process.argv[i] == "start" && process.argv[i+1] == "daemon") || (process.argv[i] == "start" && !process.argv[i+1]) || (config.cli && config.cli.mode && config.cli.mode == "daemon")) || ((process.argv[i] == "stop" && process.argv[i+1] == "daemon") || (process.argv[i] == "stop" && !process.argv[i+1]))) && !params.isChildProcess){
				if (process.getuid() != 0) {
				    log("startup", "Daemon is expected to run as root");
				    process.exit();
				    return false;
				}
				daemon
				    .on("starting", function() {
				        log("startup", "Starting daemon...");
				    })
				    .on("started", function(pid) {
				        log("startup", "Daemon started. PID: " + pid);
				        process.exit();
				    })
				    .on("stopping", function() {
				        log("startup", "Stopping daemon...");
				    })
				    .on("stopped", function(pid) {
				        log("startup", "Daemon stopped.");
				        process.exit();
				    })
				    .on("running", function(pid) {
				        log("startup", "Daemon already running. PID: " + pid);
				        process.exit();
				    })
				    .on("notrunning", function() {
				        log("startup", "Daemon is not running");
				        process.exit();
				    })
				    .on("error", function(err) {
				        log("startup", "Daemon failed to start:  " + err.message);
				        process.exit();
				    });
				if ((process.argv[i] == "start" && process.argv[i+1] == "daemon") || (process.argv[i] == "start" && !process.argv[i+1]) || (config.cli && config.cli.mode && config.cli.mode == "daemon" && !daemon.status())) {
					daemon.start();
				} else if ((process.argv[i] == "stop" && process.argv[i+1] == "daemon") || (process.argv[i] == "stop" && !process.argv[i+1]) || (config.cli && config.cli.mode && config.cli.mode == "daemon" && daemon.status())) {
					daemon.stop();
				}
				return true;
			} else if ((process.argv[i] == "status" && process.argv[i+1] == "daemon") || (process.argv[i] == "status" && !process.argv[i+1])) {
				var status = daemon.status();
				if(status){
					log("startup", "Daemon is running.");
					process.exit();
				} else {
					log("startup", "Daemon is not running.");
					process.exit();
				}
				return true;
			} else if (((process.argv[i] == "restart" && process.argv[i+1] == "daemon") || (process.argv[i] == "restart" && !process.argv[i+1]))  && !params.isChildProcess) {
				if (process.getuid() != 0) {
				    log("startup", "Daemon is expected to run as root");
				    process.exit();
				    return false;
				}
				var status = daemon.status();
				if(status){
					daemon
					    .on("starting", function() {
					        log("startup", "Starting daemon...");
					    })
					    .on("started", function(pid) {
					        log("startup", "Daemon started. PID: " + pid);
					        process.exit();
					    })
					    .on("stopping", function() {
					        log("startup", "Stopping daemon...");
					    })
					    .on("stopped", function(pid) {
					        log("startup", "Daemon stopped.");
					        process.exit();
					        daemon.start();
					    })
					    .on("running", function(pid) {
					        log("startup", "Daemon already running. PID: " + pid);
					        process.exit();
					    })
					    .on("notrunning", function() {
					        log("startup", "Daemon is not running");
					        process.exit();
					    })
					    .on("error", function(err) {
					        log("startup", "Daemon failed to start:  " + err.message);
					        process.exit();
					    });
					    daemon.stop();
				} else {
					log("fatal", "Daemon is not running. Use start command instead.");
					process.exit();
				}
			} else {
				log("fatal", "Daemon received invalid command. Terminating application.");
				process.exit();
				return false;
			}
		});		
	}
407084
function(params, callback) {
      var t = this,
          connectError = false,
          monitors = t.get('monitors');

      if (t.get('started')) {
        var err = {code:'RUNNING', msg:'Cannot start - the recipe is already running.'};
        logger.warn(err);
        return callback(err);
      }

      // Called when a monitor has connected
      var onConnect = function(error) {
        if (connectError) {return;}
        if (error) {
          var err = {code:'CONNECT_ERROR', err: error};
          connectError = true;
          logger.error('start', err);
          return callback(err);
        }
        for (var name1 in t.monitors) {
          if (!t.monitors[name1].isConnected()) {
            return;
          }
        }
        t.set({started:true});
        t.connectListeners(true);
        callback();
      };

      // Connect all monitors
      for (var name2 in monitors) {
        t.monitors[name2] = new Monitor(monitors[name2]);
        t.monitors[name2].connect(onConnect);
      }

    }
1203744
def set_status(self, status, origin=None, force=False):
        

        if not self.slave and origin not in self.program_stack:
            raise ValueError('Status cannot be changed directly')

        with self._actuator_status_lock:
            self.logger.debug("set_status got through, program: %s", origin)
            self.logger.debug("Set_status %s %s %s", self.name, origin, status)

            if self.slave:
                return self._do_change_status(status, force)

            self.logger.debug("Sets status %s for %s", status, origin.name)

            with self._program_lock:
                self.program_status[origin] = status

                if self.program == origin:
                    return self._do_change_status(status, force)