Run the requested command. args is either a list of descriptions or a list of strings to filter by
182499
def run(command, options, args):
    """"""

    if command == "backend":
        subprocess.call(("sqlite3", db_path))

    if command == "add":
        dp = pdt.Calendar()
        due = mktime(dp.parse(options.due)[0]) if options.due else None
        print "added tasks..."
        [Task(desc, due).add() for desc in args]
        return

    filters = args if len(args) else None
    rows    = Query(filters, options).find()
    tasks   = [Task(r["desc"], r["due"]) for r in rows]

    if command == "list":
        for t in tasks:
            print "\t *", t

    if command == "done":
        print "done with..."
        finished_tasks = []
        for t in tasks: 
            finished = t.done()
            if finished:
                finished_tasks.append(t)

        if not finished_tasks:
            return

        print ""
        print "finished tasks:"
        for t in finished_tasks:
            print "\t X", t
    
    if command == "remove":
        print "remove..."
        removed_tasks = []
        for t in tasks: 
            removed = t.remove()
            if removed:
                removed_tasks.append(t)
    
        if not removed_tasks:
            return
    
        print ""
        print "removed tasks:"
        for t in removed_tasks:
            print "\t RM", t
844948
def run(args: List[str],
        get_output: bool = False,
        encoding: str = sys.getdefaultencoding()) -> Tuple[str, str]:
    
    printable = " ".join(shlex.quote(x) for x in args).replace("\n", r"\n")
    log.debug("Running external command: {}", printable)
    if get_output:
        p = subprocess.run(args, stdout=subprocess.PIPE,
                           stderr=subprocess.PIPE, check=True)
        stdout, stderr = p.stdout.decode(encoding), p.stderr.decode(encoding)
    else:
        subprocess.check_call(args)
        stdout, stderr = "", ""
    return stdout, stderr
1145958
def run_cmd(input)
      safely do
        command = command_list.match(input)
        return command.new(self, input).execute if command

        puts safe_inspect(multiple_thread_eval(input))
      end
    end
1310598
def run(self, *args, **kwargs) -> Callable:
        
        return self.fn(*args, **kwargs) if args or kwargs else self.fn
362512
def run(args):
    
    if args is None:
        return
    
    cmd = args["commands"][0]
    if cmd == "configure":
        if len(args["commands"]) < 2:# pragma: no cover
            msg.err("'configure' command requires a second, sub-command "
                    "parameter. E.g., `acorn.py configure packages`.")
            exit(0)

        subcmd = args["commands"][1]
        _run_configure(subcmd, args)
335480
function runCommand(command, options) {
    let cmd = getCommand(command);
    if (!cmd || command === 'help') {
      cmd = getCommand('help');
    } else {
      try {
        validateConfig(options);
      } catch (error) {
        console.log(error.message);
        process.exit(1);
      }
    }
    let fn = cmd.callback;
    let opts = mapParams(cmd, options);
    fn(opts).then(function (result) {
      if (cmd.formatter) {
        cmd.formatter.format(result.messages, options);
      } else {
        console.log(result);
      }
    }).catch(function (error) {
      let formatter = new formatters.MessageFormatter();
      if (error.response) {
        console.log(error);
        formatter.format(['Error response received: ' + error.response.data.errors[0].message]);
      } else {

        formatter.format([error.message]);
      }
      process.exit(1);
    });
  }
881569
def run(self, *args):
        
        params = self.parser.parse_args(args)

        code = self.initialize(name=params.name, reuse=params.reuse)

        return code
714517
def run_cli(self, cli, args=None, node_paths=None):
    """"""
    cli_args = [cli]
    if args:
      cli_args.append('--')
      cli_args.extend(args)
    return self.run_command(args=cli_args, node_paths=node_paths)
899785
def run(self, command, opts):
        """"""
        handlers = { 
            'create': self.create,
            'delete': self.delete,
            'list': self.list
        }
        handler = handlers.get(command, None)
        if handler is None:
            error("Unrecognized command: %s" % command, 2)
        handler(opts)
383379
def _run_command(self, cmdline):
        """"""
        try:
            if self.verbose:
                print(cmdline)
            subprocess.check_call(cmdline, shell=True)
        except subprocess.CalledProcessError:
            print('when running: ', cmdline)
            raise
975124
def argument_run(self, sp_r):
		
		arg_run = []

		for line in sp_r:
			logging.debug("argument run: handling: " + str(line))
			if(line[1] == "data"):
				arg_run.append( (line[0], line[1], line[2], line[2].get_words(line[3])))
				continue
			if(line[1] == "command"):
				self.checkargs(line[0], line[2], line[3])
				arg_run.append( (line[0], line[1], line[2], [a for a in self.convert_args(line[2], line[3])]))
		return arg_run
380290
function run(params, command, callback)
{
  var terminator
    , requiresContext = isArrowFunction(command)
    ;

  // make sure callback is invoked in real async way
  callback = async(callback);

  // check provided function if it expected
  // to be run in async or sync way

  // expects no arguments, run it as sync function
  // unless it's function straight outta factory
  // has `.commandDescription` property
  //
  // Or it has one argument and requires context
  // must be arrow function with `context` argument
  if ((command.length === 0 || (command.length === 1 && requiresContext)) && !command.commandDescription)
  {
    runSync(this, command, callback);
  }
  else // or run it as async
  {
    // async function may return terminator function
    terminator = runAsync(this, command, callback);
  }

  // return provided terminator or empty function
  // if there is none
  return terminator || function() {};
}
432825
def run(self, **kwargs):
        
        for key in kwargs:
            setattr(self, key, kwargs[key])
        self.command = self.COMMAND_RUN
1033196
def run_args(args):
    
    return main(filename      = args.get('MDFILE')
               ,theme         = args.get('-t', 'random')
               ,cols          = args.get('-c')
               ,from_txt      = args.get('-f')
               ,c_theme       = args.get('-T')
               ,c_no_guess    = args.get('-x')
               ,do_html       = args.get('-H')
               ,no_colors     = args.get('-A')
               ,display_links = args.get('-L'))
222720
def run_command(self, cmd, argv):
        
        try:
            Command = self.get_command_class(cmd)
        except CommandError, e:
            self.stderr.write(str(e) + '\n')
            self.show_help()
            sys.exit(-1)
        command = Command(stdout=self.stdout, stderr=self.stderr)
        command.run_from_argv(argv)
1252463
def run(self, command):
        
        if isinstance(command, basestring):
            command = command.split()
        else:
            command = list(command)
        self.external.omero_cli(command)
614469
def run(self, params):
        

        self.params = list(reversed(params))

        if not self.params:
            self.help()
            return

        while self.params:
            p = self.params.pop()

            if p in self.command:
                # If we got a known command, execute it.
                self.command[p](self)

            elif os.path.exists(p):
                # If we were given the name of an existing file, read it.
                self.read_moc(p)

            else:
                # Otherwise raise an error.
                raise CommandError('file or command {0} not found'.format(p))