Send stat command to Memcached Server and return response lines.
        
        @param cmd: Command string.
        @return:    Array of strings.
756
def _sendStatCmd(self,  cmd):
        
        try:
            self._conn.write("%s\r\n" % cmd)
            regex = re.compile('^(END|ERROR)\r\n', re.MULTILINE)
            (idx, mobj, text) = self._conn.expect([regex,], self._timeout) #@UnusedVariable
        except:
            raise Exception("Communication with %s failed" % self._instanceName)
        if mobj is not None:
            if mobj.group(1) == 'END':
                return text.splitlines()[:-1]
            elif mobj.group(1) == 'ERROR':
                raise Exception("Protocol error in communication with %s."
                                % self._instanceName)
        else:
            raise Exception("Connection with %s timed out." % self._instanceName)
1075511
def _send_str(self, cmd, args):
        
        logger.debug("{} {}".format(cmd, args))
        args = args.encode('utf-8')

        le_args_len = self._little_endian(len(args))
        data = cmd.encode() + le_args_len + args
        logger.debug("Send string: {}".format(data))
        self.connection.write(data)
933696
def send_cmds(self, *cmds):
        
        promise = aplus.Promise()
        tagged_cmds = list(self._tag_cmds(*cmds))
        logger.debug("Sending cmds: %s", tagged_cmds)

        cmd_group = _get_cmds_id(*tagged_cmds)
        self._cmd_groups[cmd_group] = (tagged_cmds, promise)
        self.send(json.dumps(tagged_cmds))
        return promise
167929
def get_send_command(self, send):
		
		shutit_global.shutit_global_object.yield_to_draw()
		if send is None:
			return send
		cmd_arr = send.split()
		if cmd_arr and cmd_arr[0] in ('md5sum','sed','head'):
			newcmd = self.get_command(cmd_arr[0])
			send = send.replace(cmd_arr[0],newcmd)
		return send
631178
def cmd(send, msg, _):
    
    msg = msg.encode('utf-8')
    send(hashlib.sha512(msg).hexdigest())
273563
def send (self, command, *args, **kwargs):
        
        status   = False
        cmdobj   = self._cmddict.create(command, *args, **kwargs)
        messages = []

        if not cmdobj.validate(messages):
            for msg in messages:
                log.error(msg)
        else:
            encoded = cmdobj.encode()

            if self._verbose:
                size = len(cmdobj.name)
                pad  = (size - len(cmdobj.name) + 1) * ' '
                gds.hexdump(encoded, preamble=cmdobj.name + ':' + pad)

            try:
                values = (self._host, self._port, str(cmdobj))
                log.command('Sending to %s:%d: %s' % values)
                self._socket.sendto(encoded, (self._host, self._port))
                status = True

                with pcap.open(self.CMD_HIST_FILE, 'a') as output:
                    output.write(str(cmdobj))
            except socket.error as e:
                log.error(e.message)
            except IOError as e:
                log.error(e.message)

        return status
870019
def send_cmd(cmd, args, ret):
        
        from dvc.daemon import daemon

        if not Analytics._is_enabled(cmd):
            return

        analytics = Analytics()
        analytics.collect_cmd(args, ret)
        daemon(["analytics", analytics.dump()])
12397
def command(cmd):
    """"""
    message = create(protobuf.SEND_COMMAND_MESSAGE)
    send_command = message.inner()
    send_command.command = cmd
    return message
545692
def as_command(self, sock_info):
        """"""
        # See _Query.as_command for an explanation of this caching.
        if self._as_command is not None:
            return self._as_command

        cmd = _gen_get_more_command(self.cursor_id, self.coll,
                                    self.ntoreturn,
                                    self.max_await_time_ms)

        if self.session:
            self.session._apply_to(cmd, False, self.read_preference)
        sock_info.send_cluster_time(cmd, self.session, self.client)
        self._as_command = cmd, self.db
        return self._as_command
851020
public static SmtpRequest help(String cmd) {
        return cmd == null ? HELP_NO_ARG : new DefaultSmtpRequest(SmtpCommand.HELP, cmd);
    }
936842
public static List<String> execForLines(String... cmds) throws IORuntimeException {
		return execForLines(CharsetUtil.systemCharset(), cmds);
	}
1043721
def _run_cmd(self, cmd, key_accept=False, passwd_retries=3):
        '''
        
        '''
        if not cmd:
            return '', 'No command or passphrase', 245

        term = salt.utils.vt.Terminal(
                cmd,
                shell=True,
                log_stdout=True,
                log_stdout_level='trace',
                log_stderr=True,
                log_stderr_level='trace',
                stream_stdout=False,
                stream_stderr=False)
        sent_passwd = 0
        send_password = True
        ret_stdout = ''
        ret_stderr = ''
        old_stdout = ''

        try:
            while term.has_unread_data:
                stdout, stderr = term.recv()
                if stdout:
                    ret_stdout += stdout
                    buff = old_stdout + stdout
                else:
                    buff = stdout
                if stderr:
                    ret_stderr += stderr
                if buff and RSTR_RE.search(buff):
                    # We're getting results back, don't try to send passwords
                    send_password = False
                if buff and SSH_PRIVATE_KEY_PASSWORD_PROMPT_RE.search(buff):
                    if not self.priv_passwd:
                        return '', 'Private key file need passphrase', 254
                    term.sendline(self.priv_passwd)
                    continue
                if buff and SSH_PASSWORD_PROMPT_RE.search(buff) and send_password:
                    if not self.passwd:
                        return '', 'Permission denied, no authentication information', 254
                    if sent_passwd < passwd_retries:
                        term.sendline(self.passwd)
                        sent_passwd += 1
                        continue
                    else:
                        # asking for a password, and we can't seem to send it
                        return '', 'Password authentication failed', 254
                elif buff and KEY_VALID_RE.search(buff):
                    if key_accept:
                        term.sendline('yes')
                        continue
                    else:
                        term.sendline('no')
                        ret_stdout = ('The host key needs to be accepted, to '
                                      'auto accept run salt-ssh with the -i '
                                      'flag:\n{0}').format(stdout)
                        return ret_stdout, '', 254
                elif buff and buff.endswith('_||ext_mods||_'):
                    mods_raw = salt.utils.json.dumps(self.mods, separators=(',', ':')) + '|_E|0|'
                    term.sendline(mods_raw)
                if stdout:
                    old_stdout = stdout
                time.sleep(0.01)
            return ret_stdout, ret_stderr, term.exitstatus
        finally:
            term.close(terminate=True, kill=True)
238347
@SuppressWarnings("unchecked")
  public final Map<String, String> stats(InetSocketAddress address, long timeout)
      throws MemcachedException, InterruptedException, TimeoutException {
    if (address == null) {
      throw new IllegalArgumentException("Null inetSocketAddress");
    }
    CountDownLatch latch = new CountDownLatch(1);

    Queue<Session> sessionQueue = this.connector.getSessionByAddress(address);
    if (sessionQueue == null || sessionQueue.peek() == null) {
      throw new MemcachedException(
          "could not find session for " + SystemUtils.getRawAddress(address) + ":"
              + address.getPort() + ",maybe it have not been connected");
    }
    Command command = this.commandFactory.createStatsCommand(address, latch, null);
    final Session session = sessionQueue.peek();
    session.write(command);
    this.latchWait(command, timeout, session);
    return (Map<String, String>) command.getResult();
  }
1112306
function command(req, res) {

  this.stats.commands++;

  //console.dir(this);

  // guaranteed to have a string command by connection
  var cmd = req.cmd
    // guaranteed to have an arguments array by connection
    , args = req.args

    // select implementation should guarantee a valid db index
    // on the connection
    , db = this.store.getDatabase(req.conn.db)
    // info object used by the validate function
    , exec = this.execs[cmd]
    , info = {
      db: db, conf: this.conf, conn: req.conn, exec: exec, commands: this.execs}
    // should we queue this command in a transaction
    // of just execute it
    , queue = cmd !== DISCARD && cmd !== EXEC
    // flag if command is acceptable when busy
    , acceptable;

  // raw arguments list, before validation
  // used so that the slowlog does not show modified arguments
  req.raw = args.slice(0);

  //console.error('server processing command: %s', cmd);
  //console.error('server processing command: %j', args);
    //

  if(ScriptManager.busy && !req.script) {
    // compare on command instances
    // in case they have been renamed
    acceptable =
      (exec === Shutdown
       && ('' + args[0] || '').toLowerCase() === NOSAVE)
      || (exec === Script
        && ('' + args[0] || '').toLowerCase() === KILL);
    if(!acceptable) return res.send(StoreError.Busy);
  }

  if(exec === false) {
    return res.send(StoreError.UnknownDisabled);
  }else if(!exec) {
    return res.send(new UnknownCommand(cmd));
  }

  try {
    exec.validate.call(this, cmd, args, info);

    // inject references
    req.db = db;
    req.conf = this.conf;
    req.exec = exec;

    // these properties are available on the req
    delete info.db;
    delete info.conn;
    delete info.conf;

    // inject the info object which is decorated with
    // additional useful information on validation
    req.info = info;

    // alias the command definition
    req.def = req.exec.definition;
  }catch(e) {
    // let the transaction decide how to proceed on error
    if(req.conn.transaction) {
      return req.conn.transaction.add(e, req, res);
    }
    return res.send(e);
  }

  if(req.conn.transaction && queue) {
    return req.conn.transaction.add(null, req, res);
  }

  this.execute(exec, req, res);

}
1277865
function _send(cmd, callback) {
      cmd_callback = callback;
      if(connected) {
        client.write(cmd + '\n');
      } else {
        connect();
      }
    }
892067
def cmd(send, *_):
    
    a = ["primary", "secondary", "tertiary", "hydraulic", "compressed", "required", "pseudo", "intangible", "flux"]
    b = [
        "compressor", "engine", "lift", "elevator", "irc bot", "stabilizer", "computer", "fwilson", "csl", "4506", "router", "switch", "thingy",
        "capacitor"
    ]
    c = [
        "broke", "exploded", "corrupted", "melted", "froze", "died", "reset", "was seen by the godofskies", "burned", "corroded", "reversed polarity",
        "was accidentallied", "nuked"
    ]
    send("because %s %s %s" % ((choice(a), choice(b), choice(c))))
422452
public static StringBuffer runCommand(String[] cmd) {
    StringBuffer retval = new StringBuffer(MAX_OUTPUT_LENGTH);
    Process p;
    try {
      p = Runtime.getRuntime().exec(cmd);
      InputStream tmp = p.getInputStream();
      p.waitFor();
      int c;
      while ((c = tmp.read()) != -1)
        retval.append((char) c);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    return retval;
  }