Returns {name: Command}
350231
def _load_commands(root):
    """"""
    def proto_text(t):
        if t.tag == 'name':
            return '{name}'
        elif t.tag == 'ptype':
            return '{type}'
        out = []
        if t.text:
            out.append(_escape_tpl_str(t.text))
        for x in t:
            out.append(proto_text(x))
            if x.tail:
                out.append(_escape_tpl_str(x.tail))
        return ''.join(out)
    out = collections.OrderedDict()
    for elem in root.findall('commands/command'):
        type_elem = elem.find('proto/ptype')
        name = elem.get('name') or elem.find('proto/name').text
        type = type_elem.text if type_elem is not None else None
        proto_template = proto_text(elem.find('proto'))
        params = [_load_param(x) for x in elem.findall('param')]
        comment = elem.get('comment')
        out[name] = Command(name, type, proto_template, params, comment)
    return out
1327954
def cmd(commands, opts={})
      results = {}
      threads = clouds.collect do |name, c|
        Thread.new{ results[ name ] = c.cmd(commands, opts) }
      end
      threads.each{ |aThread| aThread.join }
      results
    end
392818
def get_command(self, name):
        """"""

        def command(options):
            client = ZookeeperClient(
                "%s:%d" % (options.pop('host'), options.pop('port')),
                session_timeout=1000
                )

            path = options.pop('path_prefix')
            force = options.pop('force')
            extra = options.pop('extra')

            # Apply settings to options dictionary. While this does
            # conflate arguments for the utility with command options,
            # that's something we're willing to accept.
            options.update(extra)

            controller = Command(client, path, self.services, force)
            method = getattr(controller, "cmd_%s" % name)
            return method(**options)

        return command
74433
def find_command(cmd, paths = [])
      exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
      paths += ENV['PATH'].split(File::PATH_SEPARATOR)
      paths.each do |path|
        exts.each do |ext|
          exe = File.join(path, "#{cmd}#{ext}")
          if (File.executable?(exe) && File.file?(exe))
            return Shellwords.escape exe
          end
        end
      end
      nil
    end
372636
def get_command(self, ctx, cmd_name):
        """"""
        rv = click.Group.get_command(self, ctx, cmd_name)
        if rv is not None:
            return rv
        cmd_name = self.command_aliases.get(cmd_name, "")
        return click.Group.get_command(self, ctx, cmd_name)
426289
def command_search( cmdlist, cmd )
      cmdlist.each do |c|
	c.init
	return c if c.name == cmd
      end
      return nil
    end
525382
def as_es2_command(command):
    

    if command[0] == 'FUNC':
        return (command[0], re.sub(r'^gl([A-Z])',
                lambda m: m.group(1).lower(), command[1])) + command[2:]
    if command[0] == 'SHADERS':
        return command[:2] + convert_shaders('es2', command[2:])
    if command[0] == 'UNIFORM':
        return command[:-1] + (command[-1].tolist(),)
    return command
119852
def get_command(self, command):
		
		shutit_global.shutit_global_object.yield_to_draw()
		if command in ('md5sum','sed','head'):
			if self.get_current_shutit_pexpect_session_environment().distro == 'osx':
				return 'g' + command
		return command
161399
def get_command(self):
        
        cmd = None
        count = len(self.command_list)
        if count > 0:
            cmd = self.command_list.pop(0)
        ## If that was the last line, turn off lines_pending
        if count == 1:
            self.cmd_ready = False
        return cmd
746976
function GetCommandList(execName, packageJson, Commands) {
  const header = `\
${packageJson.title || packageJson.name || execName} ${packageJson.version}
Usage:    ${execName} ${col.bold('<command>')} [options]
Commands:`;

  const grouped = _.groupBy(Commands, 'helpGroup');
  const sorted = _.mapValues(grouped, arr => _.sortBy(arr, 'helpPriority'));
  const sortedGroups = _.sortBy(sorted, grp => grp[0].helpPriority);
  const longestCmd = _.max(_.map(Commands, cmd => cmd.name.length));
  const commandListStr = _.map(sortedGroups, (helpGroup) => {
    const groupName = _.first(helpGroup).helpGroup;
    return _.flatten([
      `\n  * ${col.primary(groupName)}`,
      _.map(helpGroup, (cmd) => {
        const cmdName = _.padEnd(cmd.name, longestCmd);
        return `    ${col.bold(cmdName)} ${cmd.desc}`;
      }),
    ]).join('\n');
  }).join('\n');

  return `\
${header}
${commandListStr}

Use ${col.bold(`${execName} <command> -h`)} for command-specific help.`;
}
866645
function get(command) {
        var commandID;
        if (!command) {
            console.error("Attempting to get a Sort method with a missing required parameter: command");
            return;
        }

        if (typeof command === "string") {
            commandID = command;
        } else {
            commandID = command.getID();
        }
        return _sorts[commandID];
    }
1109634
def get_command(self, *path):
        """"""
        path_str = ':'.join(path)

        if path_str in self.commands:
            return self.commands[path_str].load()

        return None
1360741
function (cmd) {
    var cmdName = dotty.get(cmd, this.definitions.command.name);

    if (!cmdName) {
      var err = new Error('command has no command name in ' + this.definitions.command.name);
      debug(err);
      throw err;
    }

    var version = 0;
    if (!!this.definitions.command.version) {
      version = dotty.get(cmd, this.definitions.command.version);
    }

    var command = this.getCommand(cmdName, version);
    if (!command) {
      var aggregateId = dotty.get(cmd, this.definitions.command.aggregateId);
      var aggregateName = this.name;
      var contextName = this.context.name;

      return [{
        context: contextName,
        aggregate: aggregateName,
        aggregateId: aggregateId
      }];
    }

    return command.getLoadInfo(cmd);
  }
624607
def cmd_func(self, command: str) -> Optional[Callable]:
        
        func_name = self.cmd_func_name(command)
        if func_name:
            return getattr(self, func_name)
321052
function getCommands( str ){
	var commands = str.split('|');

	commands.forEach(function( command, key ){
		var args = command.split(':');

		args.forEach(function( arg, k ){
			args[k] = trim( arg );
		});

		commands[key] = {
			command: command,
			method: args.shift(),
			args: args
		};
	});

	return commands;
}
260789
function Command(commandSpec) {
  Object.keys(commandSpec).forEach(function(key) {
    this[key] = commandSpec[key];
  }, this);

  if (!this.name) {
    throw new Error('All registered commands must have a name');
  }

  if (this.params == null) {
    this.params = [];
  }
  if (!Array.isArray(this.params)) {
    throw new Error('command.params must be an array in ' + this.name);
  }

  this.hasNamedParameters = false;
  this.description = 'description' in this ? this.description : undefined;
  this.description = lookup(this.description, 'canonDescNone');
  this.manual = 'manual' in this ? this.manual : undefined;
  this.manual = lookup(this.manual);

  // At this point this.params has nested param groups. We want to flatten it
  // out and replace the param object literals with Parameter objects
  var paramSpecs = this.params;
  this.params = [];

  // Track if the user is trying to mix default params and param groups.
  // All the non-grouped parameters must come before all the param groups
  // because non-grouped parameters can be assigned positionally, so their
  // index is important. We don't want 'holes' in the order caused by
  // parameter groups.
  var usingGroups = false;

  if (this.returnType == null) {
    this.returnType = 'string';
  }

  // In theory this could easily be made recursive, so param groups could
  // contain nested param groups. Current thinking is that the added
  // complexity for the UI probably isn't worth it, so this implementation
  // prevents nesting.
  paramSpecs.forEach(function(spec) {
    if (!spec.group) {
      if (usingGroups) {
        throw new Error('Parameters can\'t come after param groups.' +
                        ' Ignoring ' + this.name + '/' + spec.name);
      }
      else {
        var param = new Parameter(spec, this, null);
        this.params.push(param);

        if (!param.isPositionalAllowed) {
          this.hasNamedParameters = true;
        }
      }
    }
    else {
      spec.params.forEach(function(ispec) {
        var param = new Parameter(ispec, this, spec.group);
        this.params.push(param);

        if (!param.isPositionalAllowed) {
          this.hasNamedParameters = true;
        }
      }, this);

      usingGroups = true;
    }
  }, this);
}
535217
def get_command(self, ctx, name):
        
        try:
            mod = importlib.import_module('ips_vagrant.commands.{name}'.format(name=name))
            return mod.cli
        except (ImportError, AttributeError):
            return