Return the list of commands to run.
337259
def commands(config, names):
    """"""
    commands = {cmd: Command(**dict((minus_to_underscore(k), v)
                                    for k, v in config.items(cmd)))
                for cmd in config.sections()
                if cmd != 'packages'}
    try:
        return tuple(commands[x] for x in names)
    except KeyError as e:
        raise RuntimeError(
            'Section [commands] in the config file does not contain the '
            'key {.args[0]!r} you requested to execute.'.format(e))
851698
def get_commands(self):
		
		shutit_global.shutit_global_object.yield_to_draw()
		s = ''
		for c in self.build['shutit_command_history']:
			if isinstance(c, str):
				#Ignore commands with leading spaces
				if c and c[0] != ' ':
					s += c + '\n'
		return s
42372
def find_all_commands(management_dir):
    
    try:
        #Find all commands in the directory that are not __init__.py and end in .py.  Then, remove the trailing .py
        return [f[:-3] for f in os.listdir(management_dir) if f.endswith('.py') and not f.startswith("__")]
    except OSError:
        #If nothing is found, return empty
        return []
451666
def get_commands():
    
    commands = {}

    #Try to load the settings file (settings can be specified on the command line) and get the INSTALLED_APPS
    try:
        from percept.conf.base import settings
        apps = settings.INSTALLED_APPS
    except KeyError:
        apps = []

    #For each app, try to find the command module (command folder in the app)
    #Then, try to load all commands in the directory
    for app_name in apps:
        try:
            path = find_commands_module(app_name)
            commands.update(dict([(name, app_name) for name in find_all_commands(path)]))
        except ImportError as e:
            pass

    return commands
417449
function getCommandNames(cmds) {
  var commands = _.map(cmds, '_name');
  commands = commands.concat.apply(commands, _.map(cmds, '_aliases'));
  commands.sort();
  return commands;
}
1063188
def external_commands(self):
        
        res = []
        with self.app.external_commands_lock:
            for cmd in self.app.get_external_commands():
                res.append(cmd.serialize())
        return res
487190
def get_summaries(ordered=True):
    """"""

    if ordered:
        cmditems = _sort_commands(commands_dict, commands_order)
    else:
        cmditems = commands_dict.items()

    for name, command_class in cmditems:
        yield (name, command_class.summary)
443058
def ListCommands(self):
    """"""
    print 'Available commands:'
    commands = dict(self.commands)
    for plugin in self.plugins:
      commands.update(plugin.commands)
    for com in sorted(commands):
      if not com.startswith('_'):
        self.PrintHelpTextLine(com, commands[com])
600697
def list_commands(self, ctx):
        """"""
        commands = super(LegitGroup, self).list_commands(ctx)
        return [cmd for cmd in order_manually(commands)]
587038
def walk_commands(self):
        """"""
        for command in tuple(self.all_commands.values()):
            yield command
            if isinstance(command, GroupMixin):
                yield from command.walk_commands()
147241
def get_actions(self, commands):
        """"""
        actions = []
        for type, turn_based, verb in commands:
            if len(self.action_filter) != 0 and verb not in self.action_filter:
                continue
            if type == 'DiscreteMovement':
                if verb in {"move", "turn", "look",
                            "strafe", "jumpmove", "jumpstrafe"}:
                    actions.append(verb + " 1")
                    actions.append(verb + " -1")
                elif verb in {"jumpeast", "jumpnorth", "jumpsouth",
                              "jumpwest", "movenorth", "moveeast",
                              "movesouth", "movewest", "jumpuse",
                              "use", "attack", "jump"}:
                    actions.append(verb + " 1")
                else:
                    raise CommandHandlerException("Invalid discrete command")
            elif type == 'ContinuousMovement':
                #  Translate to discrete.
                if verb in {"move", "strafe", "pitch", "turn"}:
                    actions.append(verb + " 1")
                    actions.append(verb + " -1")
                elif verb in {"crouch", "jump", "attack", "use"}:
                    actions.append(verb + " 1")
                    actions.append(verb + " 0")
                else:
                    raise CommandHandlerException("Invalid continuous command")
            elif type == 'HumanLevel':
                if verb == 'moveMouse':
                    actions.append('mouseMove 0 0')
                elif verb in {'forward', 'back', 'left', 'right'}:
                    actions.append(verb + ' 1')
                    actions.append(verb + ' 0')
                else:
                    actions.append(verb)
            elif type == 'MissionQuit':
                if verb != 'quit':
                    raise CommandHandlerException("Invalid quit command")
                actions.append(verb)
            elif type == 'Chat':
                if verb != 'chat':
                    raise CommandHandlerException("Invalid chat command")
                actions.append(verb)
            elif type == 'SimpleCraft':
                if verb != 'craft':
                    raise CommandHandlerException("Invalid craft command")
                actions.append(verb)
            elif type == 'AbsoluteMovement' or 'Inventory':
                actions.append(verb)
        return actions
1087386
def get_missing_commands(_platform):
    """"""
    missing = list()
    if _platform in ('Linux', 'OpenBSD'):
        if not LINUX_CMD_USERADD:
            missing.append('useradd')
        if not LINUX_CMD_USERMOD:
            missing.append('usermod')
        if not LINUX_CMD_USERDEL:
            missing.append('userdel')
        if not LINUX_CMD_GROUP_ADD:
            missing.append('groupadd')
        if not LINUX_CMD_GROUP_DEL:
            missing.append('groupdel')
    elif _platform == 'FreeBSD':  # pragma: FreeBSD
        # FREEBSD COMMANDS
        if not FREEBSD_CMD_PW:
            missing.append('pw')
    if missing:
        print('\nMISSING = {0}'.format(missing))
    return missing
321211
def commands(self, event):
        
        commands = sorted(self.commands_dict().keys())
        return "Available commands: %s" % " ".join(commands)
843081
def list(self):
        
        queue = self._get_queue()
        if queue is None:
            raise QueueDoesntExist

        output = self.check_output('%s' %
                                   shell_escape(queue / 'commands/list'))

        job_id, info = None, None
        for line in output.splitlines():
            line = line.decode('utf-8')
            if line.startswith('    '):
                key, value = line[4:].split(': ', 1)
                info[key] = value
            else:
                if job_id is not None:
                    yield job_id, info
                job_id = line
                info = {}
        if job_id is not None:
            yield job_id, info
1364945
def get_commands(self):
        
        commands = OrderedDict()
        for cmd in sorted(self.registry.keys()):
            commands[cmd] = self.registry[cmd]
        return commands
1350844
def walk_commands(self):
        """"""
        from .core import GroupMixin
        for command in self.__cog_commands__:
            if command.parent is None:
                yield command
                if isinstance(command, GroupMixin):
                    yield from command.walk_commands()
804433
def list_commands(self, *path):
        """"""
        path_str = ':'.join(path)

        commands = []
        for command in self.commands:

            # Filter based on prefix and the segment length
            if all([command.startswith(path_str),
                    len(path) == command.count(":")]):

                # offset is used to exclude the path that the caller requested.
                offset = len(path_str) + 1 if path_str else 0
                commands.append(command[offset:])

        return sorted(commands)