Toggles maintenance mode.
438143
def maintenance(self, on=True):
        """"""

        r = self._h._http_resource(
            method='POST',
            resource=('apps', self.name, 'server', 'maintenance'),
            data={'maintenance_mode': int(on)}
        )
        return r.ok
629788
def modes_off(self):
        """"""
        bm = self.fitsimage.get_bindmap()
        bm.reset_mode(self.fitsimage)
1323798
def enter_maintenance_mode(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The enter_maintenance_mode function must be called with '
            '-f or --function.'
        )

    host_name = kwargs.get('host') if kwargs and 'host' in kwargs else None

    host_ref = salt.utils.vmware.get_mor_by_property(_get_si(), vim.HostSystem, host_name)

    if not host_name or not host_ref:
        raise SaltCloudSystemExit(
            'You must specify a valid name of the host system.'
        )

    if host_ref.runtime.inMaintenanceMode:
        return {host_name: 'already in maintenance mode'}

    try:
        task = host_ref.EnterMaintenanceMode(timeout=0, evacuatePoweredOffVms=True)
        salt.utils.vmware.wait_for_task(task, host_name, 'enter maintenance mode')
    except Exception as exc:
        log.error(
            'Error while moving host system %s in maintenance mode: %s',
            host_name, exc,
            # Show the traceback if the debug logging level is enabled
            exc_info_on_loglevel=logging.DEBUG
        )
        return {host_name: 'failed to enter maintenance mode'}

    return {host_name: 'entered maintenance mode'}
1136130
public void toggle() {
    Command cmd = state.isPrimary() ? command1 : command2;
    setState(state.other());
    cmd.execute();
  }
333449
def toggle(self, section, option):
  """"""
  self.set(section, option, not self.get(section, option))
344899
def toggle_wrap_mode(self, checked):
        """"""
        self.plain_text.editor.toggle_wrap_mode(checked)
        self.set_option('wrap', checked)
93347
def toggle_service(self):
        
        self.monitoring_disabled.emit(not self.service.is_running())
        if self.service.is_running():
            self.pause_service()
        else:
            self.unpause_service()
62773
def toggleSelection(self, index, comp):
        """"""
        self.model.toggleSelection(index.row(), comp)
425882
def reset_mode(self):
        """"""
        self.command(0x18, b"\x01", timeout=0.1)
        self.transport.write(Chipset.ACK)
        time.sleep(0.010)
1182498
async def toggle(self):
        """"""

        self.logger.debug("toggle command")

        if not self.state == 'ready':
            return

        if self.streamer is None:
            return

        try:
            if self.streamer.is_playing():
                await self.pause()
            else:
                await self.resume()
        except Exception as e:
            logger.error(e)
            pass
335882
def setBusy(self, busy):
        '''
        
        '''
        self._busy = busy
        if not self._busy:
            self._pump()
42354
def mode(self, target, *data):
        """"""
        self.send_line('MODE %s %s' % (target, ' '.join(data)), nowait=True)
942639
public function setUpMode()
    {
        $file = $this->maintenanceFilePath();

        if (file_exists($file) && !unlink($file)) {
            $message = sprintf(
                'Something went wrong on trying to remove maintenance file %s.',
                $file
            );

            throw new Exceptions\FileException($message);
        }

        return true;
    }
289317
void enableKeepAlive(boolean enable, long keepAliveTimeNanos,
      long keepAliveTimeoutNanos, boolean keepAliveWithoutCalls) {
    enableKeepAlive = enable;
    this.keepAliveTimeNanos = keepAliveTimeNanos;
    this.keepAliveTimeoutNanos = keepAliveTimeoutNanos;
    this.keepAliveWithoutCalls = keepAliveWithoutCalls;
  }
224068
def toggle_all(self, checked):
        """"""
        self.parent_widget.sig_option_changed.emit('show_all', checked)
        self.show_all = checked
        self.set_show_all(checked)
642128
def temporarily_disabled(self):
        
        old_setting = self.options.enabled
        self.disable(clear_cache=False)
        try:
            yield
        finally:
            self.options.enabled = old_setting
368741
def toggle_inhibit(self):
        """"""
        if self.inhibit:
            self._controller.set_inhibit(False)
            self.inhibit = False
        else:
            self._controller.set_inhibit(True)
            self.inhibit = True