command text
        view: Execution user view exec
              Configuration system view exec
550164
def request(self, command=None):
        
        node = new_ele("CLI")
        node.append(validated_element(command))
        # sub_ele(node, view).text = command
        return self._request(node)
614993
def __execute_cmd(name, xml):
    '''
    
    '''
    ret = {name.replace('_', ' '): {}}
    id_num = 0

    tmp_dir = os.path.join(__opts__['cachedir'], 'tmp')
    if not os.path.isdir(tmp_dir):
        os.mkdir(tmp_dir)
    with tempfile.NamedTemporaryFile(dir=tmp_dir,
                                     prefix=name + six.text_type(os.getpid()),
                                     suffix='.xml',
                                     delete=False) as fh:
        tmpfilename = fh.name
        fh.write(xml)

    cmd = __salt__['cmd.run_all']('hponcfg -f {0}'.format(tmpfilename))

    # Clean up the temp file
    __salt__['file.remove'](tmpfilename)

    if cmd['retcode'] != 0:
        for i in cmd['stderr'].splitlines():
            if i.startswith('     MESSAGE='):
                return {'Failed': i.split('=')[-1]}
        return False

    try:
        for i in ET.fromstring(''.join(cmd['stdout'].splitlines()[3:-1])):
            # Make sure dict keys don't collide
            if ret[name.replace('_', ' ')].get(i.tag, False):
                ret[name.replace('_', ' ')].update(
                    {i.tag + '_' + six.text_type(id_num): i.attrib}
                )
                id_num += 1
            else:
                ret[name.replace('_', ' ')].update(
                    {i.tag: i.attrib}
                )
    except SyntaxError:
        return True

    return ret
47182
public void clickOnView(View view) {
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "clickOnView("+view+")");
		}
		
		view = waiter.waitForView(view, Timeout.getSmallTimeout());
		clicker.clickOnScreen(view);
	}
171513
def execute_command(cmd, execute, echo=True):
    """"""
    if execute:
        if echo:
            print("Executing: " + cmd)
        return os.system(cmd)
    else:
        print(cmd)
        return 0
893901
def do_view(self):
        
        self.current.output['login_process'] = True
        self.current.task_data['login_successful'] = False
        if self.current.is_auth:
            self._do_upgrade()
        else:
            try:
                auth_result = self.current.auth.authenticate(
                    self.current.input['username'],
                    self.current.input['password'])
                self.current.task_data['login_successful'] = auth_result
                if auth_result:
                    self._do_upgrade()
            except ObjectDoesNotExist:
                self.current.log.exception("Wrong username or another error occurred")
                pass
            except:
                raise
            if self.current.output.get('cmd') != 'upgrade':
                self.current.output['status_code'] = 403
            else:
                KeepAlive(self.current.user_id).reset()
1179433
private void execute(String command) throws XAException {
    try {
      connection.createStatement().execute(command);
    } catch (SQLException sqle) {
      throw mapXaException(sqle);
    }
  }
774539
private void gitCommand(Path temporaryDir, String... command) throws Exception {
        // remove sensitive credentials from command before printing to console
        String displayedCommand = String.join(" ", command).replaceAll(getRemoteUrl(), getDisplayedRemoteUrl());
        Clog.d("Github Pages GIT: {}", displayedCommand);

        // but pass directly to system shell to execute
        execGitCommand(temporaryDir, command);
    }
1228645
@SuppressWarnings("unchecked")
        public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            List<String> metaKeys = null;
            String url = null;
            List<Integer> nodeIds = null;
            Boolean allNodes = true;
            List<String> storeNames = null;

            // parse command-line input
            args = AdminToolUtils.copyArrayAddFirst(args, "--" + OPT_HEAD_META_GET_RO);
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            // check required options and/or conflicting options
            AdminParserUtils.checkRequired(options, OPT_HEAD_META_GET_RO);
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);
            AdminParserUtils.checkOptional(options,
                                           AdminParserUtils.OPT_NODE,
                                           AdminParserUtils.OPT_ALL_NODES);
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_STORE);

            // load parameters
            metaKeys = (List<String>) options.valuesOf(OPT_HEAD_META_GET_RO);
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);
            if(options.has(AdminParserUtils.OPT_NODE)) {
                nodeIds = (List<Integer>) options.valuesOf(AdminParserUtils.OPT_NODE);
                allNodes = false;
            }
            storeNames = (List<String>) options.valuesOf(AdminParserUtils.OPT_STORE);

            // execute command
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            if(allNodes) {
                nodeIds = AdminToolUtils.getAllNodeIds(adminClient);
            }

            if(metaKeys.size() == 1 && metaKeys.get(0).equals(METAKEY_ALL)) {
                metaKeys = Lists.newArrayList();
                metaKeys.add(KEY_MAX_VERSION);
                metaKeys.add(KEY_CURRENT_VERSION);
                metaKeys.add(KEY_STORAGE_FORMAT);
            }

            doMetaGetRO(adminClient, nodeIds, storeNames, metaKeys);
        }
917414
function exec(command) {
  var tempName = temp.path({suffix: '.exec'});
  var cmd;
  if (isWindows)
    cmd = command + ' > ' + tempName + ' 2>&1';
  else
    cmd = '(' + command + ') > ' + tempName + ' 2>&1';

  var code = run(cmd);
  var text;

  if (fs.existsSync(tempName)) {
    try {
      text = fs.readFileSync(tempName, 'utf8');
      fs.unlink(tempName);
    } catch (err) {
      throw new Error('ERROR: could not delete capture file');
    }
  } else {
    throw new Error('ERROR: output not captured');
  }

  return {
    code: code,
    stdout: text
  }
}
1316316
def run_command(self, command):
        
        self.display = DISPLAYS["stdout"]
        self.conf["pagesize"] = 0
        self.onecmd(command)
468654
def exec_cmd(self, command, **kwargs):
        

        if command == 'load':
            if kwargs:
                kwargs = dict(options=[kwargs])
        return self._exec_cmd(command, **kwargs)
937640
private static boolean executesAsSimpleDirective(String line) throws Exception {

        // SHOW or LIST <blah> statement
        String subcommand = SQLParser.parseShowStatementSubcommand(line);
        if (subcommand != null) {
            if (subcommand.equals("proc") || subcommand.equals("procedures")) {
                execListProcedures();
            }
            else if (subcommand.equals("functions")) {
                execListFunctions();
            }
            else if (subcommand.equals("tables")) {
                execListTables();
            }
            else if (subcommand.equals("classes")) {
                execListClasses();
            }
            else if (subcommand.equals("config") || subcommand.equals("configuration")) {
                execListConfigurations();
            }
            else {
                String errorCase = (subcommand.equals("") || subcommand.equals(";")) ?
                        ("Incomplete SHOW command.\n") :
                        ("Invalid SHOW command completion: '" + subcommand + "'.\n");
                System.out.println(errorCase +
                        "The valid SHOW command completions are proc, procedures, tables, or classes.");
            }
            // Consider it handled here, whether or not it was a good SHOW statement.
            return true;
        }

        // HELP commands - ONLY in interactive mode, close batch and parse for execution
        // Parser returns null if it isn't a HELP command. If no arguments are specified
        // the returned string will be empty.
        String helpSubcommand = SQLParser.parseHelpStatement(line);
        if (helpSubcommand != null) {
            // Ignore the arguments for now.
            if (!helpSubcommand.isEmpty()) {
                System.out.printf("Ignoring extra HELP argument(s): %s\n", helpSubcommand);
            }
            printHelp(System.out); // Print readme to the screen
            return true;
        }

        String echoArgs = SQLParser.parseEchoStatement(line);
        if (echoArgs != null) {
            System.out.println(echoArgs);
            return true;
        }

        String echoErrorArgs = SQLParser.parseEchoErrorStatement(line);
        if (echoErrorArgs != null) {
            System.err.println(echoErrorArgs);
            return true;
        }

        // DESCRIBE table
        String describeArgs = SQLParser.parseDescribeStatement(line);
        if (describeArgs != null) {

            // Check if table exists
            String tableName = "";
            String type = "";
            VoltTable tableData = m_client.callProcedure("@SystemCatalog", "TABLES").getResults()[0];
            while (tableData.advanceRow()) {
                String t = tableData.getString(2);
                if (t.equalsIgnoreCase(describeArgs)) {
                    tableName = t;
                    type = tableData.getString(3);
                    break;
                }
            }
            if (tableName.equals("")) {
                System.err.println("Table does not exist");
                return true;
            }

            // Class to temporarily store and sort column attributes
            class Column implements Comparable {
                String name;
                String type;
                long size;
                String remarks;
                long position;
                String notNull;

                @Override
                public String toString() {return "";}

                @Override
                public int compareTo(Object obj) {
                    Column col = (Column) obj;
                    return (int)(this.position - col.position);
                }
            }

            // sort the columns as they are inserted
            SortedSet set = new TreeSet();

            // Retrieve Column attributes
            VoltTable columnData = m_client.callProcedure("@SystemCatalog", "COLUMNS").getResults()[0];
            int maxNameWidth = 10;
            while (columnData.advanceRow()) {
                if (tableName.equalsIgnoreCase(columnData.getString(2))) {

                    Column c = new Column();
                    c.name = columnData.getString(3);
                    if (c.name.length() > maxNameWidth) {
                        maxNameWidth = c.name.length();
                    }

                    c.type = columnData.getString(5);

                    c.size = columnData.getLong(6);
                    if (columnData.wasNull()) {
                        if (c.type.equals("GEOGRAPHY")) {
                            c.size = 32768;
                        }
                        if (c.type.equals("GEOGRAPHY_POINT")) {
                            c.size = 16;
                        }
                    } else if (c.type.equals("TINYINT")) {
                        c.size = 1;
                    } else if (c.type.equals("SMALLINT")) {
                        c.size = 2;
                    } else if (c.type.equals("INTEGER")) {
                        c.size = 4;
                    } else if (c.type.equals("BIGINT")) {
                        c.size = 8;
                    } else if (c.type.equals("FLOAT")) {
                        c.size = 8;
                    } else if (c.type.equals("DECIMAL")) {
                        c.size = 16;
                    } else if (c.type.equals("TIMESTAMP")) {
                        c.size = 8;
                    }

                    c.remarks = columnData.getString(11);
                    if (columnData.wasNull()) {
                        c.remarks = "";
                    }

                    c.position = columnData.getLong(16);

                    String nullableYesNo = columnData.getString(17);
                    c.notNull = "";
                    if (nullableYesNo.equals("NO")) {
                        c.notNull = "NOT NULL";
                    }

                    set.add(c);
                }
            }

            // print output
            String headerFormat = "%-" + maxNameWidth + "s|%-16s|%-11s|%-9s|%-16s\n";
            String rowFormat = "%-" + maxNameWidth + "s|%-16s|%11d|%-9s|%-16s\n";
            System.out.printf(headerFormat,"COLUMN","DATATYPE","SIZE","NULLABLE","REMARKS");
            String DASHES = new String(new char[56+maxNameWidth]).replace("\0", "-");
            System.out.println(DASHES);

            Iterator it = set.iterator();
            while (it.hasNext()) {
                Column c = (Column)it.next();
                System.out.printf(rowFormat,c.name,c.type,c.size,c.notNull,c.remarks);
            }
            System.out.println(DASHES);

            // primary key
            String primaryKey = "";
            VoltTable keyData = m_client.callProcedure("@SystemCatalog", "PRIMARYKEYS").getResults()[0];
            while (keyData.advanceRow()) {
                if (tableName.equalsIgnoreCase(keyData.getString(2))) {
                    String colName = keyData.getString(3);
                    if (!primaryKey.equals("")) {
                        primaryKey += ",";
                    }
                    primaryKey += colName;
                }
            }
            if (!primaryKey.equals("")) {
                System.out.println("Type: " + type + ", Primary Key (" + primaryKey + ")");
            } else {
                System.out.println("Type: " + type);
            }
            return true;
        }

        // It wasn't a locally-interpreted directive.
        return false;
    }
1338158
def _execShowCountCmd(self, showcmd):
        
        result = None
        lines = self._execCmd("show", showcmd + " count")
        for line in lines:
            mobj = re.match('\s*(\d+)\s+total', line)
            if mobj:
                return int(mobj.group(1))
        return result
264934
public static String execForStr(Charset charset, String... cmds) throws IORuntimeException {
		return getResult(exec(cmds), charset);
	}
1146230
public static void processCommandLine(TextUICommandLine commandLine, String[] argv, IFindBugsEngine findBugs)
            throws IOException, FilterException {
        // Expand option files in command line.
        // An argument beginning with "@" is treated as specifying
        // the name of an option file.
        // Each line of option files are treated as a single argument.
        // Blank lines and comment lines (beginning with "#")
        // are ignored.
        try {
            argv = commandLine.expandOptionFiles(argv, true, true);
        } catch (HelpRequestedException e) {
            showHelp(commandLine);
        }

        int argCount = 0;
        try {
            argCount = commandLine.parse(argv);
        } catch (IllegalArgumentException e) {
            LOG.severe(e.getMessage());
            showHelp(commandLine);
        } catch (HelpRequestedException e) {
            showHelp(commandLine);
        }

        Project project = commandLine.getProject();
        for (int i = argCount; i < argv.length; ++i) {
            project.addFile(argv[i]);
        }
        commandLine.handleXArgs();

        commandLine.configureEngine(findBugs);
        if (commandLine.getProject().getFileCount() == 0 &&
                !commandLine.justPrintConfiguration() && !commandLine.justPrintVersion()) {
            LOG.warning("No files to be analyzed");

            showHelp(commandLine);
        }
    }
711085
def execute_and_report(command, *args, **kwargs):
    
    logging.info("Execute: %s %s" % (command, " ".join(args)))
    try:
        status, out, err = execute(command, *args, **kwargs)
        if status == 0:
            logging.info(
                "%s Finished successfully. Exit Code: 0.",
                os.path.basename(command),
            )
            return True
        else:
            try:
                logging.error(
                    "%s failed! Exit Code: %s\nOut: %s\nError: %s",
                    os.path.basename(command),
                    status,
                    out,
                    err,
                )
            except Exception as e:
                # This fails when some non ASCII characters are returned
                # from the application
                logging.error(
                    "%s failed [%s]! Exit Code: %s\nOut: %s\nError: %s",
                    e,
                    os.path.basename(command),
                    status,
                    repr(out),
                    repr(err),
                )
            return False
    except Exception:
        logging.exception(
            "%s failed! Exception thrown!", os.path.basename(command)
        )
        return False
344844
public function exec()
    {
        $name = $this->argument('name');
        $aliased = $this->option('alias');

        $process = Query::create($name);
        //
        if ($aliased) {
            // Alias::update('querying.'.$name, 'App\Queries\\'.$name);
        }
        //
        $this->show($process, $name);
    }