Exit enable mode.
970878
def exit_enable_mode(self, exit_command="exit"):
        """"""
        delay_factor = self.select_delay_factor(delay_factor=0)
        output = ""
        if self.check_enable_mode():
            self.write_channel(self.normalize_cmd(exit_command))
            time.sleep(0.3 * delay_factor)
            self.set_base_prompt()
            if self.check_enable_mode():
                raise ValueError("Failed to exit enable mode.")
        return output
600358
def power_off(env, identifier, hard):
    """"""

    virtual_guest = env.client['Virtual_Guest']
    vsi = SoftLayer.VSManager(env.client)
    vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS')
    if not (env.skip_confirmations or
            formatting.confirm('This will power off the VS with id %s. '
                               'Continue?' % vs_id)):
        raise exceptions.CLIAbort('Aborted.')

    if hard:
        virtual_guest.powerOff(id=vs_id)
    else:
        virtual_guest.powerOffSoft(id=vs_id)
590894
def exit_config_mode(self, exit_config="return", pattern=r">"):
        """"""
        return super(HuaweiBase, self).exit_config_mode(
            exit_config=exit_config, pattern=pattern
        )
267559
def close(self):
        """"""
        if self._device is not None:
            ibsta = self._lib.ibonl(self._device, 0)
            self._check_status(ibsta)
            self._device = None
1280886
def disable(self):
        """"""
        self.post("disable")
        if self.service.restart_required:
            self.service.restart(120)
        return self
42304
def do_quit(self, _: argparse.Namespace) -> bool:
        """"""
        self._should_quit = True
        return self._STOP_AND_EXIT
788227
def stop(self):
        
        _curses.nocbreak()
        self.window.keypad(0)
        _curses.echo()
        _curses.resetty()
        _curses.endwin()
        self.running = False
580967
def do_quit(self, arg):
        """"""
        if self.saved:
            self.save()
        else:
            self.parser.clean()
        return True
783962
def off(self):
        """"""
        off_command = ExtendedSend(self._address,
                                   COMMAND_LIGHT_OFF_0X13_0X00,
                                   self._udata)
        off_command.set_checksum()
        self._send_method(off_command, self._off_message_received)
811146
def stop(self, timeout_s=None):
    """"""
    self._live = False
    try:
      self._sock.shutdown(socket.SHUT_RDWR)
      self._sock.close()
    except socket.error:
      pass
    self.join(timeout_s)
1260574
def enable_disable(self):
        
        if self.enabled:
            self.data['enabled'] = False
        else:
            self.data['enabled'] = True
        self.update()
387481
def away(dev, away_end, temperature):
    
    if away_end:
        click.echo("Setting away until %s, temperature: %s" % (away_end, temperature))
    else:
        click.echo("Disabling away mode")
    dev.set_away(away_end, temperature)
965862
def quit(self):
        """"""
        sys.stdout = self._oldstdout
        sys.stderr = self._oldstderr
        self.destroy()
1342206
def exit(self):
        """"""
        if self.client is not None:
            self.client.close()
        if self.context is not None:
            self.context.destroy()
566242
def _exit(self, status_code):
        """"""
        # If there are active threads still running infinite loops, sys.exit
        # won't kill them but os._exit will. os._exit skips calling cleanup
        # handlers, flushing stdio buffers, etc.
        exit_func = os._exit if threading.active_count() > 1 else sys.exit
        exit_func(status_code)
1134694
def leave_command_mode(self, append_to_history=False):
        
        client_state = self.get_client_state()

        client_state.command_buffer.reset(append_to_history=append_to_history)
        client_state.prompt_buffer.reset(append_to_history=True)

        client_state.prompt_command = ''
        client_state.confirm_command = ''

        client_state.app.layout.focus_previous()
990860
def exit_config_mode(self, exit_config="exit", pattern=""):
        """"""
        if not pattern:
            pattern = re.escape(self.base_prompt)
        return super(CiscoWlcSSH, self).exit_config_mode(exit_config, pattern)