Returns the previous command, if any.
8332
def scroll_up(self):
        
        self._index += 1
        nb_commands = len(self._history)
        if self._index >= nb_commands:
            self._index = nb_commands - 1
        try:
            return self._history[self._index]
        except IndexError:
            return ''
1137928
def get_command(self, version=2):
        """"""
        try:
            options = _C['options']
            options_str = " -o ".join(options)
            if options_str:
                options_str = "-o " + options_str + " "
        except KeyError:
            options_str = ""

        if self.username:
            # Not supported on SunOS
            # "-o ConnectTimeout={}
            command = "ssh {}" \
                      "-{} " \
                      "-p {} {}@{}".format(options_str, version, self.port, self.username, self.hostname)
        else:
            command = "ssh {} " \
                      "-{} " \
                      "-p {} {}".format(options_str, version, self.port, self.hostname)
        return command
684499
def get_previous_instance(self, obj):
        
        ordered_siblings = obj.get_siblings().filter(placeholder=obj.placeholder).order_by('position')
        pos = list(ordered_siblings).index(obj.cmsplugin_ptr)
        if pos > 0:
            prev_sibling = ordered_siblings[pos - 1]
            return prev_sibling.get_bound_plugin()
1342260
def insertNextCommand(self):
        
        self._currentHistoryIndex += 1
        if 0 <= self._currentHistoryIndex < len(self._history):
            cmd = self._history[self._currentHistoryIndex]
        else:
            cmd = '>>> '
            self._currentHistoryIndex = -1
        
        self.replaceCommand(cmd)
578530
def previous_key(tuple_of_tuples, key):
    
    for i, t in enumerate(tuple_of_tuples):
        if t[0] == key:
            try:
                return tuple_of_tuples[i - 1][0]
            except IndexError:
                return None
1364945
def get_commands(self):
        
        commands = OrderedDict()
        for cmd in sorted(self.registry.keys()):
            commands[cmd] = self.registry[cmd]
        return commands
538123
def cmddict(self):
        """"""
        if self._cmddict is None:
            self._cmddict = cmd.getDefaultDict()

        return self._cmddict
1137491
def commands(self):
        
        if self._commands is None:
            self._commands = CommandList(self)
        return self._commands
1090375
function defaultCommand() {
    if (keys.length <= 0) {
        throw new Error("Error: there is no command at all!");
    };

    for (var p in commands) {
        if (commands[p]["default"]) {
            return commands[p];
        };
    };

    if (keys["--help"]) {
        return commands["--help"];
    } else {
        return commands[keys[0]];
    };
}
949036
def get_command(self, ctx, name):
        """"""
        if not self._commands_dir:
            return defaults.get_command(ctx, name)

        ns = {}
        fn = os.path.join(self._commands_dir, name + '.py')

        try:
            with open(fn) as f:
                code = compile(f.read(), fn, 'exec')
        except IOError:
            return defaults.get_command(ctx, name)

        eval(code, ns, ns)

        CLI = 'cli'

        try:
            return ns[CLI]
        except KeyError:
            ctx.fail('`{}` not defined in "{}"'.format(CLI, name))
943439
def help(self, command=None):
        
        cmd = 'help'
        if command: cmd += ' %s' % command
        return self.fetch(cmd)[1]
653240
def previousExon(self) :
		""""""
		
		if self.number == 0 :
			return None
		
		try :
			return self.transcript.exons[self.number-1]
		except IndexError :
			return None
1109470
def get_create_command(self):
        """"""
        command = ['git', 'clone' if self.remote else 'init']
        if self.bare:
            command.append('--bare')
        if self.remote:
            command.append(self.remote)
        command.append(self.local)
        return command
364771
def previous_row(self):
        """"""
        if self.mode == self.SYMBOL_MODE:
            self.select_row(-1)
            return
        prev_row = self.current_row() - 1
        if prev_row >= 0:
            title = self.list.item(prev_row).text()
        else:
            title = ''
        if prev_row == 0 and '</b></big><br>' in title:
            self.list.scrollToTop()
        elif '</b></big><br>' in title:
            # Select the next previous row, the one following is a title
            self.select_row(-2)
        else:
            self.select_row(-1)
875598
def get_full_command_record(self, command_history_id,
                                merge_session_environ=True):
        
        with self.connection() as db:
            crec = self._select_command_record(db, command_history_id)
            crec.pipestatus = self._get_pipestatus(db, command_history_id)
            # Set environment variables
            cenv = self._select_environ(db, 'command', command_history_id)
            crec.environ.update(cenv)
            if merge_session_environ:
                senv = self._select_environ(
                    db, 'session', crec.session_history_id)
                crec.environ.update(senv)
        return crec
622164
def get_old_value(self, args, kwargs, default=None):
        # type: (List[Any], Dict[str, Any], Any) -> Any
        
        if self.arg_pos is not None and len(args) > self.arg_pos:
            return args[self.arg_pos]
        else:
            return kwargs.get(self.name, default)
1363164
def get_full_command(self):
        
        if self.is_command():
            command, _, args = self.text.partition(' ')
            return command, args