Builds an IQ stanza containing a specific command with given body, ready to send to the hub.

@param command
@param body
@returns {Stanza}
4458
function buildCommandIqStanza (command, body) {
  debug('buildCommandIqStanza for command "' + command + '" with body ' + body)

  return xmppUtil.buildIqStanza(
    'get'
    , 'connect.logitech.com'
    , 'vnd.logitech.harmony/vnd.logitech.harmony.engine?' + command
    , body
  )
}
1079329
public synchronized Response doCommandFullResponse(String command) throws CommandFormatException, IOException {
        ModelNode request = cmdCtx.buildRequest(command);
        boolean replacedBytes = replaceFilePathsWithBytes(request);
        OperationResponse response = execute(request, isSlowCommand(command) || replacedBytes);
        return new Response(command, request, response);
    }
28311
protected Pair<Integer, InputStream> executeCommand(String command) {
        int resultVal = 1;
        InputStream inputStream = null;
        try {
            logger.debug("Executing command: {}", command);
            Process process =  Runtime.getRuntime().exec(command);

            resultVal = process.waitFor();
            inputStream = process.getInputStream();

        } catch (InterruptedException e) {
            logger.info("Execution of {} failed: code - {} ; message - {}", command, resultVal, e.getMessage());
            Thread.currentThread().interrupt();
        } catch (IOException  e) {
            logger.info("Execution of {} failed: code - {} ; message - {}", command, resultVal, e.getMessage());
        }
        if (inputStream == null) {
           // Create an empty InputStream instead of returning a null
           inputStream = new InputStream() {
               @Override
               public int read() throws IOException {
                   return -1;
               }
           } ;
        }
        return new Pair<>(resultVal, inputStream);
    }
781015
function execIECommand( command ) {
			var doc = editor.document,
				body = doc.getBody(),
				enabled = false,
				onExec = function() {
					enabled = true;
				};

			// The following seems to be the only reliable way to detect that
			// clipboard commands are enabled in IE. It will fire the
			// onpaste/oncut/oncopy events only if the security settings allowed
			// the command to execute.
			body.on( command, onExec );

			// IE7: document.execCommand has problem to paste into positioned element.
			( CKEDITOR.env.version > 7 ? doc.$ : doc.$.selection.createRange() )[ 'execCommand' ]( command );

			body.removeListener( command, onExec );

			return enabled;
		}
1052468
def __create_header(self, command, command_string, session_id, reply_id):
        
        buf = pack('<4H', command, 0, session_id, reply_id) + command_string
        buf = unpack('8B' + '%sB' % len(command_string), buf)
        checksum = unpack('H', self.__create_checksum(buf))[0]
        reply_id += 1
        if reply_id >= const.USHRT_MAX:
            reply_id -= const.USHRT_MAX

        buf = pack('<4H', command, checksum, session_id, reply_id)
        return buf + command_string
593210
function(command, host, options, cb) {
  let child = null;

  if(env === Constants.RESERVED.ENV_DEV) {
    child = cp.spawn(command, options);
    let prefix = command === Constants.COMMAND.SSH ? '[' + host + '] ' : '';

    child.stderr.on('data', function (chunk) {
      let msg = chunk.toString();
      process.stderr.write(msg);
      if(!!cb) {
        cb(msg);
      }
    });

    child.stdout.on('data', function (chunk) {
      let msg = prefix + chunk.toString();
      process.stdout.write(msg);
    });
  } else {
    child = cp.spawn(command, options, {detached: true, stdio: 'inherit'});
    child.unref();
  }

  child.on('exit', function (code) {
    if(code !== 0) {
      logger.warn('child process exit with error, error code: %s, executed command: %s', code,  command);
    }
    if (typeof cb === 'function') {
      cb(code === 0 ? null : code);
    }
  });
}
965167
function(command, callback) {
		command = 'curl https://api.spark.io/v1/devices/' + this.config.deviceId + '/' + command + '?access_token=' + this.config.token;
		this.debug('Running command: ', command);
		child = exec(command,
			function (error, stdout, stderr) {
			this.debug('stdout: ' + stdout);
			this.debug('stderr: ' + stderr);
			if (error !== null) {
				this.debug('exec error: ' + error);
			}
			if (callback) {
				try {
					callback(JSON.parse(stdout));
				}
				catch (err) {
					callback(undefined);
				}
			}
		}.bind(this));
	}
930898
public ProcessExecutor command(Iterable<String> command) {
    List<String> list = new ArrayList<String>();
    Iterator<String> it = command.iterator();
    while (it.hasNext()) {
      list.add(it.next());
    }
    return command(list);
  }
32476
@NonNull
    public EmailIntentBuilder body(@NonNull String body) {
        checkNotNull(body);
        this.body = fixLineBreaks(body);
        return this;
    }
604883
def _send_command(self, command):
        
        try:
            if isinstance(command, list):
                for cmd in command:
                    output = self.device.send_command(cmd)
                    if "% Invalid" not in output:
                        break
            else:
                output = self.device.send_command(command)
            return self._send_command_postprocess(output)
        except (socket.error, EOFError) as e:
            raise ConnectionClosedException(str(e))
737704
function send_command(command, cb) {
        var cmd = commands[command.toUpperCase()];
        if(parseInt(cmd)) {
            post('/roap/api/command', `<?xml version='1.0' encoding='utf-8'?><command><name>HandleKeyInput</name><value>${cmd}</value></command>`, (body) => {
                try {
                    var doc = new dom().parseFromString(body);
                    if(cb) cb(xpath.select('//ROAPErrorDetail/text()', doc).toString() == 'OK')
                } catch(error) {
                    log(`error send_command:  ${error.message}`)
                    if(cb) cb(false)
                }
            });
        }
    }
1211682
public <T> CompletableFuture<T> submit(Command<T> command) {
    State state = state();
    if (state == State.CLOSED || state == State.EXPIRED) {
      return Futures.exceptionalFuture(new ClosedSessionException("session closed"));
    }
    return submitter.submit(command);
  }
539627
private Map<String,Object> createMessageHeaders(KubernetesCommand<?> command) {
        Map<String, Object> headers = new HashMap<String, Object>();

        headers.put(KubernetesMessageHeaders.COMMAND, command.getName());

        for (Map.Entry<String, Object> entry : command.getParameters().entrySet()) {
            headers.put(entry.getKey(), entry.getValue());
        }

        return headers;
    }
579482
function(command, bodyLength, status) {
        if (null == bodyLength) {
            bodyLength = 0
        }

        if (null == status) {
            status = 0
        }

        // ----------- 存放1字节的command和1字节的status
        var buffer = new Buffer(2)
        buffer.writeUInt8(command, 0)
        buffer.writeUInt8(status, 1)

        // 生成8bytes存放body length的buffer
        var blBuffer = helpers.number2Buffer(bodyLength, 8)

        // 拼接
        return Buffer.concat([blBuffer, buffer])
    }
600283
def command(command_name, *args)
      response_key = "#{command_name}_response".to_sym
      result_key = "#{command_name}_result".to_sym

      message = args.last.is_a?(Hash) ? args.pop : {}
      result = @client.call command_name,
                            cookies: @auth_cookie,
                            message: { :token => @login_token }.merge(message)

      result.hash[:envelope][:body][response_key][result_key]
    end
504161
public synchronized ModelNode doCommand(String command) throws CommandFormatException, IOException {
        ModelNode request = cmdCtx.buildRequest(command);
        return execute(request, isSlowCommand(command)).getResponseNode();
    }
1122364
def sendCommand(self, command):
        
        command_data = [ord(x) for x in buffer(command)]
        self.hid.write(command_data)
        response_data = ''.join(chr(x) for x in self.hid.read(64))
        response = command.RESPONSE.from_buffer_copy(response_data)
        if response.status != 0:
            raise CommandException(response.status)
        return response