Respond to the SETNAME subcommand.
434335
function setname(req, res) {
  req.conn.client.name = req.args[0];
  res.send(null, Constants.OK);
}
1187834
def execute_command(self, request, command, frame):
        """"""
        return Response(frame.console.eval(command), mimetype="text/html")
305987
def command(self, command, value=1, check=True, allowable_errors=None,
                codec_options=DEFAULT_CODEC_OPTIONS, _deadline=None, **kwargs):
        """"""
        if isinstance(command, (bytes, unicode)):
            command = SON([(command, value)])
        options = kwargs.copy()
        command.update(options)

        def on_ok(response):
            if check:
                msg = "TxMongo: command {0} on namespace {1} failed with '%s'".format(repr(command), ns)
                _check_command_response(response, msg, allowable_errors)

            return response

        ns = self["$cmd"].with_options(codec_options=codec_options)
        return ns.find_one(command, _deadline=_deadline).addCallback(on_ok)
1140841
def action_set(values):
    """"""
    cmd = ['action-set']
    for k, v in list(values.items()):
        cmd.append('{}={}'.format(k, v))
    subprocess.check_call(cmd)
307745
def respond(self, obj):
        """"""

        # Get the callback argument if JSONP is allowed
        callback = self.get_argument("callback", None) if oz.settings["allow_jsonp"] else None

        # We're pretty strict with what callback names are allowed, just in case
        if callback and not CALLBACK_VALIDATOR.match(callback):
            raise oz.json_api.ApiError("Invalid callback identifier - only functions with ASCII characters are allowed")

        # Provide the response in a different manner depending on whether a
        # JSONP callback is specified
        json = escape.json_encode(obj)

        if callback:
            self.set_header("Content-Type", "application/javascript; charset=UTF-8")
            self.finish("%s(%s)" % (callback, json))
        else:
            self.set_header("Content-Type", "application/json; charset=UTF-8")
            self.finish(json)
516236
def setResponse(self, response):
        
        self.response = response
        self.result = self.response.body

        if isinstance(self.result, remoting.ErrorFault):
            self.result.raiseException()
891849
def _PreParse(self, key, value):
        """"""
        if key == "Command":
            return re.sub(r"(\[\[.+?\]\])", self._Completion, value)
        else:
            return value
289266
def add_subcommands(parser, commands):
    ""
    subps = parser.add_subparsers()
    for cmd, cls in commands:
        subp = subps.add_parser(cmd, help=cls.__doc__)
        add_args = getattr(cls, 'add_arguments', None)
        if add_args:
            add_args(subp)
        handler = getattr(cls, 'handle', None)
        if handler:
            subp.set_defaults(handler=handler)
500653
def declare_response(self, code='200', **kwargs):
        """"""  # noqa: E501
        self['responses'][str(code)] = self._new_operation(**kwargs)
612954
def launch_set(nickname_substr)
      set = select_set(nickname_substr)  
      set.each { |s|
        begin
          object_behavior(s, :start)
        rescue Exception => e
          raise e unless e.message =~ /AlreadyLaunchedError/
        end
      }
    end
1344062
def set_name(self, name):
        """"""
        if not name:
            name = ''
        self._client['config']['name'] = name
        yield from self._server.client_name(self.identifier, name)
3091
def execute_command(self, *args, **options):
        """"""
        pool = self.connection_pool
        command_name = args[0]
        for i in _xrange(self.execution_attempts):
            connection = pool.get_connection(command_name, **options)
            try:
                connection.send_command(*args)
                res = self.parse_response(connection, command_name, **options)
                pool.release(connection)
                return res
            except ConnectionError:
                pool.purge(connection)
                if i >= self.execution_attempts - 1:
                    raise
1303790
function reply(req, res, timeout) {
  var _timer;

  if(timeout) {
    //console.dir(timeout);
    //console.error(Date.now());
    _timer = setTimeout(this.onTimeout, timeout);
    this._busy = true;
  }

  function onClose(code, signal) {
    //console.dir('close called: ' + signal);
    //console.dir(code);
    //console.dir(signal);
    this.ps.removeAllListeners();
    clearTimeout(_timer);
    this.ps = null;
    this._busy = false;
    this._written = false;
    var msg, err = new StoreError(
      null, 'script execution process exited with code: %s', code || 0);
    if(signal === 'SIGQUIT') {
      msg = 'error running script (call to %s): '
      msg += '@user_script: script killed by user with SCRIPT KILL';
      err = new StoreError(null, msg, this._script || 'user_script');
    }
    res.send(err);
  }

  function onMessage(msg) {
    var cmd, args;

    //console.dir(msg);

    // getting the current script name
    if(msg.event === 'eval') {
      this._script = msg.data;
      return;

    // calling out to execute a command
    }else if(msg.event === 'call') {
      req.cmd = msg.cmd;
      req.args = msg.args;

      //console.dir('got call event');

      var exec = this._commands[req.cmd];
      if(exec && exec.definition && exec.definition.write) {
        this._written = true;
        //console.dir('marking command as writing data...');
      }

      function onCommand(err, reply) {
        // restore req and res
        req.cmd = cmd;
        req.args = args;
        req.script = false;
        delete res.cb;

        var data = err ? err.message : reply;
        if(reply instanceof Buffer) reply = reply.toString();
        this.ps.send(
          {event: msg.event, err: (err instanceof Error), data: data});
      }

      req.script = true;

      res.cb = onCommand.bind(this);
      this.emit('command', req, res);
      //this.ps.once('message', onMessage.bind(this));
      return;
    }

    // ps may be null if script was killed
    if(this.ps) {
      this.ps.removeAllListeners();
    }

    clearTimeout(_timer);

    // sending data back to the client
    this._busy = false;
    this._written = false;
    var data = msg.data;
    if(msg.err) return res.send(new Error(data));
    if(msg.str) data = new String(data);
    return res.send(null, data);
  }

  this.ps.on('message', onMessage.bind(this));
  this.ps.once('close', onClose.bind(this));
}
688547
def _sendDDEcommand(self, cmd, timeout=None):
        """"""
        reply = self.conversation.Request(cmd, timeout)
        if self.pyver > 2:
            reply = reply.decode('ascii').rstrip()
        return reply
201865
def set_name(self, name="My Colormap"):
        
        if not type(name)==str:
            print("set_name(): Name must be a string.")
            return
        self._name = name
        return self
823166
public SubCommandSet add(SubCommand<SubCommandDef> subCommand) {
        if (subCommandMap.containsKey(subCommand.getName())) {
            throw new IllegalArgumentException("SubCommand with name " + subCommand.getName() + " already exists");
        }
        this.subCommands.add(subCommand);
        this.subCommandMap.put(subCommand.getName(), subCommand);
        for (String alias : subCommand.getAliases()) {
            if (subCommandMap.containsKey(alias)) {
                throw new IllegalArgumentException("SubCommand (" + subCommand.getName() + ") alias " + alias + " already exists");
            }
            this.subCommandMap.put(alias, subCommand);
        }
        return this;
    }
175366
def cmd(send, msg, args):
    """'

    """
    if not hasattr(args['handler'], msg):
        send("That attribute was not found in the handler.")
        return
    send(str(getattr(args['handler'], msg)))