Set mode on target.
        Users should only rely on the mode actually being changed when receiving an on_{channel,user}_mode_change callback.
545975
async def set_mode(self, target, *modes):
        
        if self.is_channel(target) and not self.in_channel(target):
            raise NotInChannel(target)

        await self.rawmsg('MODE', target, *modes)
1140384
def set_mode(self, mode):
        
        values = {"desired_state": {"mode": mode}}
        response = self.api_interface.set_device_state(self, values)
        self._update_state_from_response(response)
146804
def set_mode(self, mode):
        """"""
        _LOGGER.debug('State change called from alarm device')
        if not mode:
            _LOGGER.info('No mode supplied')
        elif mode not in CONST.ALL_MODES:
            _LOGGER.warning('Invalid mode')
        response_object = self._lupusec.set_mode(CONST.MODE_TRANSLATION[mode])
        if response_object['result'] != 1:
            _LOGGER.warning('Mode setting unsuccessful')

        self._json_state['mode'] = mode
        _LOGGER.info('Mode set to: %s', mode)
        return True
977935
def set_mode_apm(self, mode, custom_mode = 0, custom_sub_mode = 0):
        ''''''
        if isinstance(mode, str):
            mode_map = self.mode_mapping()
            if mode_map is None or mode not in mode_map:
                print("Unknown mode '%s'" % mode)
                return
            mode = mode_map[mode]
        # set mode by integer mode number for ArduPilot
        self.mav.set_mode_send(self.target_system,
                               mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED,
                               mode)
322862
def set_mode_cb(self, mode, tf):
        """"""
        if tf:
            self.canvas.set_draw_mode(mode)
            if mode == 'edit':
                self.edit_select_mark()
        return True
76485
async def on_raw_004(self, message):
        
        target, hostname, ircd, user_modes, channel_modes = message.params[:5]

        # Set valid channel and user modes.
        self._channel_modes = set(channel_modes)
        self._user_modes = set(user_modes)
818857
def clear_mode(self, mode, value=None):
        
        try:
            if mode in self.user_modes:
                del self.mode_users[mode][value]
            else:
                del self.modes[mode]
        except KeyError:
            pass
1042435
def on_bind_target(self, target, ctx=None):
        

        _on_bind_target = getattr(self, Annotation._ON_BIND_TARGET, None)

        if _on_bind_target is not None:
            _on_bind_target(self, target=target, ctx=ctx)
438644
def _set_mode(self):
        
        if self.mode is not None:
            logger.debug("changing permission bits of %s to %s", self.path, oct(self.mode))
            os.chmod(self.path, self.mode)
820136
function setToolMode(mode, changeEvent, toolName, options) {
  _trackGlobalToolModeChange(mode, toolName, options);
  store.state.enabledElements.forEach(element => {
    setToolModeForElement(mode, changeEvent, element, toolName, options);
  });
}
42354
def mode(self, target, *data):
        """"""
        self.send_line('MODE %s %s' % (target, ' '.join(data)), nowait=True)
260698
function(e) {
			var self = this;
	
			if (self.isLocked) return;
			if (self.settings.mode === 'multi') {
				e.preventDefault();
				self.setActiveItem(e.currentTarget, e);
			}
		}
1095057
private void changeFormMode(@AuthMode int mode) {
        Log.d(TAG, "Mode changed to " + mode);
        if (lastFormMode == mode || !showDatabase && !showEnterprise) {
            return;
        }
        Log.d(TAG, "Mode changed to " + mode);
        lastFormMode = mode;
        lockWidget.showTopBanner(false);
        if (socialLayout != null) {
            socialLayout.setCurrentMode(mode);
        }
        switch (mode) {
            case AuthMode.LOG_IN:
                showLogInForm();
                lockWidget.showBottomBanner(false);
                lockWidget.updateButtonLabel(R.string.com_auth0_lock_action_log_in);
                break;
            case AuthMode.SIGN_UP:
                showSignUpForm();
                lockWidget.showBottomBanner(true);
                lockWidget.updateButtonLabel(R.string.com_auth0_lock_action_sign_up);
                break;
        }
    }
198205
def set_fan_mode(self, mode):
        
        desired_state = {"fan_mode": mode}

        response = self.api_interface.set_device_state(self, {
            "desired_state": desired_state
        })

        self._update_state_from_response(response)
596395
def target_sdp_state(self, state):
        """"""
        LOG.info('Setting SDP target state to %s', state)
        if self._sdp_state.current_state == state:
            LOG.info('Target state ignored, SDP is already "%s"!', state)
        if state == 'on':
            self.set_state(DevState.ON)
        if state == 'off':
            self.set_state(DevState.OFF)
        if state == 'standby':
            self.set_state(DevState.STANDBY)
        if state == 'disable':
            self.set_state(DevState.DISABLE)
        self._sdp_state.update_target_state(state)
316252
def set(self, **kwargs):
        
        self.explorer.set(**kwargs)
        self.protocoler.set(**kwargs)
        self.tone_calibrator.set(**kwargs)
        self.charter.set(**kwargs)
        self.bs_calibrator.set(**kwargs)
        self.mphone_calibrator.set(**kwargs)
123283
def set(self, is_on=None, brightness=None, cancel_transition=True):
        
        if cancel_transition:
            self._cancel_active_transition()

        if is_on is not None:
            self._is_on = is_on

        if brightness is not None:
            self._assert_is_brightness(brightness)
            self._brightness = brightness

        self._update_pwm()