cannot send commands to boards that have not provided a token.
546761
function handle(js,line){
    // handle message from board.
    //stream.log("handle",stream.token,line);

    var hasToken = stream.token;
    if(js.type == "token") {

      // send in event stream.
      stream.queue(js); 
      stream.token = js.token;

      if(!hasToken) {
        readycb(false,stream);
        clearTimeout(readyTimeout); 
      }
      return;
    }

    if(!stream.token) return stream.log('data from socket before auth/id token.',js);

    if(js.type == 'reply'){

      o = stream.callbacks[js.id]||{};

      if(o.id === undefined) return stream.log('got reply with no id mapping! ',js);


      var output = js.output||js.reply||"";
      var ret = js.return;// not set yet.

      if(!o.output) o.output = "";
      // handle chunked responses. they come in order.
      o.output += output;

      // soon the firmware will support returning the return int value of the scout script function/expression. it willbe the property return.
      if(ret) {
        o.return = ret;
      }

      js._cid = js.id;
      js.id = o.id;

      if(js.err || js.end) {

        delete stream.callbacks[js._cid];
        js.reply = js.output = o.output;
        js.return = o.return;
        o.cb(js.err,js)
      }

    } else if(js.type == "report" && line == stream._lastreport){
      // duplicate reports are not really useful to propagate as events because nothing changed.
      return;// stream.log('duplicate report ',line);
    } else if (js.type == "report") {
      stream._lastreport = line;
      stream.queue(js);// send report in stream.
    } else {
      stream.log('unknown message type',js);
    }
  }
1087386
def get_missing_commands(_platform):
    """"""
    missing = list()
    if _platform in ('Linux', 'OpenBSD'):
        if not LINUX_CMD_USERADD:
            missing.append('useradd')
        if not LINUX_CMD_USERMOD:
            missing.append('usermod')
        if not LINUX_CMD_USERDEL:
            missing.append('userdel')
        if not LINUX_CMD_GROUP_ADD:
            missing.append('groupadd')
        if not LINUX_CMD_GROUP_DEL:
            missing.append('groupdel')
    elif _platform == 'FreeBSD':  # pragma: FreeBSD
        # FREEBSD COMMANDS
        if not FREEBSD_CMD_PW:
            missing.append('pw')
    if missing:
        print('\nMISSING = {0}'.format(missing))
    return missing
28592
private void sendMessage(AuthenticationManagerRequest req) {
    Message<AuthenticationManagerRequest> msg = new Message<AuthenticationManagerRequest>(AuthenticationManagerCommandAction.COMMAND_NAME, req);
    try {
      sender.sendMessage(msg, null);
    } catch (Exception e) {
      log.error("Failed to update authentication.", e);
    }
  }
662879
def _send_command(self, method_name, data=None):
        
        try:
            response = self.lib.post(self._tpl_url % {'token': self.auth_token, 'method': method_name}, data=data)
            json = response.json()

            if not json['ok']:
                raise TelegramMessengerException(json['description'])

            return json['result']

        except self.lib.exceptions.RequestException as e:
            raise TelegramMessengerException(e)
879508
def nack(self, frame):
        
        if not frame.headers.get('message-id'):
            raise ProtocolError("No message-id specified for NACK command.")
        if not frame.headers.get('subscription'):
            raise ProtocolError("No subscription specified for NACK command.")
554934
def send_command(self, *args, **kwargs):
        """"""

        # Change send_command behavior to use self.base_prompt
        kwargs.setdefault("auto_find_prompt", False)

        # refresh self.base_prompt
        self.set_base_prompt()
        return super(ExtremeExosBase, self).send_command(*args, **kwargs)
861154
def send_command_ack(self, device_id, action):
        """"""
        # serialize commands
        yield from self._ready_to_send.acquire()
        acknowledgement = None
        try:
            self._command_ack.clear()
            self.send_command(device_id, action)

            log.debug('waiting for acknowledgement')
            try:
                yield from asyncio.wait_for(self._command_ack.wait(),
                                            TIMEOUT.seconds, loop=self.loop)
                log.debug('packet acknowledged')
            except concurrent.futures._base.TimeoutError:
                acknowledgement = {'ok': False, 'message': 'timeout'}
                log.warning('acknowledge timeout')
            else:
                acknowledgement = self._last_ack.get('ok', False)
        finally:
            # allow next command
            self._ready_to_send.release()

        return acknowledgement
1290605
def _send_command(self, command):
        
        if self.status is None or self.status.media_session_id is None:
            self.logger.warning(
                "%s command requested but no session is active.",
                command[MESSAGE_TYPE])
            return

        command['mediaSessionId'] = self.status.media_session_id

        self.send_message(command, inc_session_id=True)
1048908
function askForDockerPushCommand() {
    if (this.regenerate) return;

    const done = this.async();

    const prompts = [
        {
            type: 'input',
            name: 'dockerPushCommand',
            message: 'What command should we use for push Docker image to repository?',
            default: this.dockerPushCommand ? this.dockerPushCommand : 'docker push'
        }
    ];

    this.prompt(prompts).then(props => {
        this.dockerPushCommand = props.dockerPushCommand;
        done();
    });
}
402762
function sendMessage(command, opt_value, opt_transfer) {
    // TODO(benvanik): attempt to use webkitPostMessage
    originalPostMessage.call(goog.global, {
      '__wtf_worker_msg__': true,
      'command': command,
      'value': opt_value || null
    }, []);
  }
253362
def send_push(type, payload = nil, target = nil, opts = {})
      cmd = {:name => :send_push, :type => type, :payload => payload, :target => target, :options => opts}
      # Need to execute on EM main thread where command client is running
      EM.next_tick { @client.send_command(cmd) }
    end
292831
def command(command)
    
      if ! @authed
        raise NetworkException.new("You must authenticate the connection successfully before sending commands.")
      end

      @packet = Packet::Source.new
      @packet.command(command)

      @socket.print @packet.to_s
      rpacket = build_response_packet

      if rpacket.command_type != Packet::Source::RESPONSE_NORM
        raise NetworkException.new("error sending command: #{rpacket.command_type}")
      end

      if @return_packets
        return rpacket
      else
        return rpacket.string1
      end
    end
1284714
public byte[] sendUnbindResp(OutputStream os, int commandStatus,
            int sequenceNumber) throws IOException {
        synchronized (os) {
            return pduSender.sendUnbindResp(os, commandStatus, sequenceNumber);
        }
    }
248354
def do_disable_commands(self, _):
        """"""
        message_to_print = "{} is not available while {} commands are disabled".format(COMMAND_NAME,
                                                                                       self.CMD_CAT_APP_MGMT)
        self.disable_category(self.CMD_CAT_APP_MGMT, message_to_print)
        self.poutput("The Application Management commands have been disabled")
651529
def _command(self, msg):
        """"""
        logger.debug('send command to %s', "ws://{}:{}".format(self.ip, self.port));
        try:
            websocket = yield from websockets.connect(
                "ws://{}:{}".format(self.ip, self.port), timeout=self.timeout_connect)
        except:
            logger.debug('command failed to connect to %s', "ws://{}:{}".format(self.ip, self.port));
            return False

        logger.debug('command websocket connected to %s', "ws://{}:{}".format(self.ip, self.port));

        try:
            yield from self._send_register_payload(websocket)

            if not self.client_key:
                raise PyLGTVPairException("Unable to pair")

            yield from websocket.send(json.dumps(msg))

            if msg['type'] == 'request':
                raw_response = yield from websocket.recv()
                self.last_response = json.loads(raw_response)

        finally:
            logger.debug('close command connection to %s', "ws://{}:{}".format(self.ip, self.port));
            yield from websocket.close()
117374
def update_token(*tokens)
      tokens.map do |token|
        begin
          id = get_id_from_token(token) # As token should be in list
          fail SlackBotManager::InvalidToken if !id || id.empty?

          # Issue reset command
          storage.set(teams_key, id, 'restart')
          true
        rescue => err
          on_error(err)
          false
        end
      end
    end
193731
function send_command(RequiresSession, Command, Parameters, callback) {

			// Check for requirements.
			if (RequiresSession && !Member.session_id) {
				if (callback) { callback(Error('No existing session found. Login required.'), null); }
				return;
			}

			// Start a new transaction.
			var transaction_id = 'TX-' + unique_id();

			// Set up the one time response handler.
			Socket.once(Command + '.' + transaction_id,
				function(Err, Response) {
					if (callback) { callback(Err, Response); }
					return;
				});

			// Clone the command parameters and mark it with our control structure.
			var parameters = JSON.parse(JSON.stringify(Parameters));
			parameters.control = {
				transaction_id: transaction_id,
				session_id: Member.session_id
			};

			// Invoke the function.
			Socket.emit(Command, parameters);

			return;
		}