Operation: Set CPC Power Save (any CPC mode).
435317
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # async not supported yet
        cpc_oid = uri_parms[0]
        try:
            cpc = hmc.cpcs.lookup_by_oid(cpc_oid)
        except KeyError:
            raise InvalidResourceError(method, uri)
        check_required_fields(method, uri, body, ['power-saving'])

        power_saving = body['power-saving']
        if power_saving not in ['high-performance', 'low-power', 'custom']:
            raise BadRequestError(method, uri, reason=7,
                                  message="Invalid power-saving value: %r" %
                                  power_saving)

        cpc.properties['cpc-power-saving'] = power_saving
        cpc.properties['cpc-power-saving-state'] = power_saving
        cpc.properties['zcpc-power-saving'] = power_saving
        cpc.properties['zcpc-power-saving-state'] = power_saving
750458
async def turn_on(self):
        """"""
        _LOGGER.debug("turn_on while %s", self._state)
        if self._state in [State.STANDBY, State.OFF, State.UNKNOWN]:
            await self.send_cmd('Power')
            self._state = State.PLAYING_LIVE_TV
        return self._state
815236
def set_pwm(self, channel, on, off):
        """"""
        self.i2c.write8(LED0_ON_L+4*channel, on & 0xFF)
        self.i2c.write8(LED0_ON_H+4*channel, on >> 8)
        self.i2c.write8(LED0_OFF_L+4*channel, off & 0xFF)
        self.i2c.write8(LED0_OFF_H+4*channel, off >> 8)
556136
def sync_heater_control(self, device_id, fan_status=None,
                            power_status=None):
        """"""
        loop = asyncio.get_event_loop()
        task = loop.create_task(self.heater_control(device_id,
                                                    fan_status,
                                                    power_status))
        loop.run_until_complete(task)
1064070
def set_mode_cb(self, mode, tf):
        """"""
        if tf:
            self.canvas.set_draw_mode(mode)
            if mode == 'edit':
                self.edit_select_cuts()
        return True
571878
def set_state(self, state):
        
        if self.index() == 0:
            values = {"outlets": [{"desired_state": {"powered": state}}, {}]}
        else:
            values = {"outlets": [{}, {"desired_state": {"powered": state}}]}

        response = self.api_interface.set_device_state(self, values, id_override=self.parent_id(),
                                                       type_override="powerstrip")
        self._update_state_from_response(response)
540055
def set_host_power(self, power):
        
        power = power.upper()
        if (power is not None) and (power not in POWER_STATE):
            msg = ("Invalid input '%(pow)s'. "
                   "The expected input is ON or OFF." %
                   {'pow': power})
            raise exception.IloInvalidInputError(msg)

        # Check current power status, do not act if it's in requested state.
        cur_status = self.get_host_power_status()

        if cur_status == power:
            LOG.debug(self._("Node is already in '%(power)s' power state."),
                      {'power': power})
            return
        if power == 'ON' and 'PROLIANT BL' in self.get_product_name().upper():
            self._retry_until_powered_on(power)
        else:
            self._perform_power_op(POWER_STATE[power])
1256348
def no_sleep():
	
	mode = power.ES.continuous | power.ES.system_required
	handle_nonzero_success(power.SetThreadExecutionState(mode))
	try:
		yield
	finally:
		handle_nonzero_success(power.SetThreadExecutionState(power.ES.continuous))
380130
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # async not supported yet
        cpc_oid = uri_parms[0]
        try:
            cpc = hmc.cpcs.lookup_by_oid(cpc_oid)
        except KeyError:
            raise InvalidResourceError(method, uri)
        check_required_fields(method, uri, body, ['power-capping-state'])

        power_capping_state = body['power-capping-state']
        power_cap_current = body.get('power-cap-current', None)

        if power_capping_state not in ['disabled', 'enabled', 'custom']:
            raise BadRequestError(method, uri, reason=7,
                                  message="Invalid power-capping-state value: "
                                  "%r" % power_capping_state)

        if power_capping_state == 'enabled' and power_cap_current is None:
            raise BadRequestError(method, uri, reason=7,
                                  message="Power-cap-current must be provided "
                                  "when enabling power capping")

        cpc.properties['cpc-power-capping-state'] = power_capping_state
        cpc.properties['cpc-power-cap-current'] = power_cap_current
        cpc.properties['zcpc-power-capping-state'] = power_capping_state
        cpc.properties['zcpc-power-cap-current'] = power_cap_current
701508
def update(self):
        """"""
        if not self._continuous_sampling \
                or self._light_level < 0 \
                or self._operation_mode != self._mode:
            self._reset()
            self._set_mode(self._operation_mode)
            self._wait_for_result()
        self._light_level = self._get_result()
        if not self._continuous_sampling:
            self._power_down()
1260902
def resp_set_power(self, resp, power_level=None):
        
        if power_level is not None:
            self.power_level=power_level
        elif resp:
            self.power_level=resp.power_level
4733
def power_off(self):
        """"""
        try:
            if self.send_get_command(self._urls.command_power_standby):
                self._power = POWER_STANDBY
                self._state = STATE_OFF
                return True
            else:
                return False
        except requests.exceptions.RequestException:
            _LOGGER.error("Connection error: power off command not sent.")
            return False
224709
def powerUp(self):
        """"""
        print '%s call powerUp' % self.port
        if not self.handle:
            self._connect()

        self.isPowerDown = False

        if not self.__isOpenThreadRunning():
            self.__startOpenThread()
721304
def powerDown(self):
        """"""
        print '%s call powerDown' % self.port
        self._sendline('reset')
        self.isPowerDown = True
813186
def set_power_state(state)
      new_action = { 'Action' => 'Reset', 'ResetType' => state }
      response = rest_post('/redfish/v1/Systems/1/', body: new_action)
      response_handler(response)
      true
    end
757832
def set_enable(self, channel, value):
        '''
        '''
        try:
            bit = self._ch_map[channel]['GPIOEN']['bit']
        except KeyError:
            raise ValueError('set_enable() not supported for channel %s' % channel)
        self._set_power_gpio_value(bit=bit, value=value)
1314317
def power_down(self):
        
        GPIO.output(self._pd_sck, False)
        GPIO.output(self._pd_sck, True)
        time.sleep(0.01)
        return True