Respond to the INFO subcommand.
519893
function info(req, res) {
  var list = []
    , i
    , exec;
  for(i = 0;i < req.args.length;i++) {
    exec = this.execs[req.args[i]];
    list.push(exec ? exec.definition.getDefinition() : null);
  }
  res.send(null, list);
}
1282691
def _simple_command(self, command, arg=None, **kwargs):
    """"""
    self._protocol.send_command(command, arg)
    return self._protocol.handle_simple_responses(**kwargs)
1153365
def _handle_response(response, command, id_xpath='./id', **kwargs):
    
    _response_switch = {
        'insert': ModifyResponse,
        'replace': ModifyResponse,
        'partial-replace': ModifyResponse,
        'update': ModifyResponse,
        'delete': ModifyResponse,
        'search-delete': SearchDeleteResponse,
        'reindex': Response,
        'backup': Response,
        'restore': Response,
        'clear': Response,
        'status': StatusResponse,
        'search': SearchResponse,
        'retrieve': ListResponse,
        'similar': ListResponse,
        'lookup': LookupResponse,
        'alternatives': AlternativesResponse,
        'list-words': WordsResponse,
        'list-first': ListResponse,
        'list-last': ListResponse,
        'retrieve-last': ListResponse,
        'retrieve-first': ListResponse,
        'show-history': None,
        'list-paths': ListPathsResponse,
        'list-facets': ListFacetsResponse}
    try:
        request_class = _response_switch[command]
    except KeyError:
        request_class = Response
    return request_class(response, id_xpath, **kwargs)
372241
def info(self, message, *args, **kwargs):
        """"""
        self.log("info", message, *args, **kwargs)
478990
async def _response_handler(self):
        """"""
        if self.debug is True:
            if self.debug is True:
                print("listenning response!")
        while True:
            try:
                res = await self.reader.readuntil(self.SEPARATOR)
            except:
                raise
            else:
                response = self.decoder(res)
                self._status_code_check(response)
654231
def interact(title, description, prompt, binary, options):
    """"""
    args = [binary]
    p = subprocess.Popen(args=args,
                         stdin=subprocess.PIPE,
                         stdout=subprocess.PIPE,
                         env=os.environ)
    p.args = args  # TODO: remove after Python 2 deprecation.
    expect(p, [b'OK'])

    title = util.assuan_serialize(title.encode('ascii'))
    write(p, b'SETTITLE ' + title + b'\n')
    expect(p, [b'OK'])

    if description:
        description = util.assuan_serialize(description.encode('ascii'))
        write(p, b'SETDESC ' + description + b'\n')
        expect(p, [b'OK'])

    if prompt:
        prompt = util.assuan_serialize(prompt.encode('ascii'))
        write(p, b'SETPROMPT ' + prompt + b'\n')
        expect(p, [b'OK'])

    log.debug('setting %d options', len(options))
    for opt in options:
        write(p, b'OPTION ' + opt + b'\n')
        expect(p, [b'OK', b'ERR'])

    write(p, b'GETPIN\n')
    pin = expect(p, [b'OK', b'D '], confidential=True)

    p.communicate()  # close stdin and wait for the process to exit
    exit_code = p.wait()
    if exit_code:
        raise subprocess.CalledProcessError(exit_code, binary)

    return pin.decode('ascii').strip()
511020
def handle(self, *args, **options):
        """"""
        self.verbosity = int(options.get('verbosity'))
        self.quiet = options.get('quiet')
        self._set_logger_level()

        self.servername = options.get('servername')
        self.decrypt = options.get('decrypt')
        self.uncompress = options.get('uncompress')

        self.filename = options.get('input_filename')
        self.path = options.get('input_path')

        self.replace = options.get('replace')
        self.passphrase = options.get('passphrase')
        self.interactive = options.get('interactive')

        self.storage = get_storage()
        self.media_storage = get_storage_class()()
        self._restore_backup()
1318519
def handle_one_command(self):
        """"""

        while True:
            yield from self.write_prompt()
            codeobj = yield from self.read_command()

            if codeobj is not None:
                yield from self.run_command(codeobj)
1306117
def dispatch_command(self, command, params=None):
        """"""
        try:
            if command in self.handlers:
                self.handlers[command](**params)
            else:
                logging.warning('Unsupported command: %s: %s',
                                command, params)
        except Exception as e:
            logging.warning('Error during command execution',
                            exc_info=sys.exc_info())
            raise e
560781
def handle(self, *args, **options):
        """"""
        self.verbosity = int(options.get('verbosity'))
        self.quiet = options.get('quiet')
        self._set_logger_level()

        try:
            connection.close()
            self.filename = options.get('input_filename')
            self.path = options.get('input_path')
            self.servername = options.get('servername')
            self.decrypt = options.get('decrypt')
            self.uncompress = options.get('uncompress')
            self.passphrase = options.get('passphrase')
            self.interactive = options.get('interactive')
            self.database_name, self.database = self._get_database(options)
            self.storage = get_storage()
            self._restore_backup()
        except StorageError as err:
            raise CommandError(err)
1109615
def cmd(send, msg, args):
    
    if not msg:
        send("What is your question?")
        # let people !8ball again if they screw up and forget the part where you ask a question.
        args['handler'].abuselist[args['nick']]['8ball'].pop()
        return
    answers = {
        "It is certain": "yes",
        "It is decidedly so": "yes",
        "Without a doubt": "yes",
        "Yes, definitely": "yes",
        "You may rely on it": "yes",
        "As I see it, yes": "yes",
        "Most likely": "yes",
        "Outlook good": "yes",
        "Yes": "yes",
        "Signs point to yes": "yes",
        "Reply hazy, try again": "maybe",
        "Ask again later": "maybe",
        "Better not tell you now": "maybe",
        "Cannot predict now": "maybe",
        "Concentrate and ask again": "maybe",
        "Don't count on it": "no",
        "My reply is no": "no",
        "My sources say no": "no",
        "Outlook not so good": "no",
        "Very doubtful": "no"
    }
    answer = choice(list(answers.keys()))
    send('says... %s' % answer, 'action')
239245
def handle_data(self, data):
        """"""
        if 'id' in data:
            self.handle_response(data)
        else:
            self.handle_notification(data)
670291
function respond(options, content, cache) {
				// cache the response

				var cached = that.responseCache.set(state, queryId, options, cache);

				// send the response back to the client

				cb(null, content, options);

				// log the execution time

				var msg = cached ?
					'Executed and cached user command batch' :
					'Executed user command batch (could not cache)';

				logger.debug
					.data({
						batch: batch.commandNames,
						queryId: queryId,
						durationMsec: duration(),
						options: options,
						dataSize: content.length
					})
					.log(msg);
			}
422417
function command(cmd, args, info) {
  var map = info.commands || Constants.MAP
    , def = map[cmd]
    , sub;

  // support command exec handlers that
  // encapsulate the definition
  if(def && def.definition !== undefined) {
    def = def.definition;
  }

  // top-level command
  if(def === undefined) {
    throw new UnknownCommand(cmd);
  }

  // made it this far, check subcommands
  // for commands that require a subcommand
  if(Constants.SUBCOMMAND[cmd] && args.length > 0) {
    sub = Constants.SUBCOMMAND[cmd][args[0]];
    if(!sub) {
      if(cmd === Constants.MAP.client.name) {
        throw ClientSyntax;
      }
      throw UnknownSubcommand;
    }
    // mutate the sub response to include
    // the subcommand as a primary command
    // and the remaining arguments, callers
    // can use this to locate a subcommand
    // execution method
    sub = {def: sub, cmd: args[0], args: args.slice(1)};
  }

  return {cmd: cmd, args: args, def: def, sub: sub};
}
1188631
def echo(bot, update):
    """"""
    message = update.get_effective_message()
    bot.reply(update, message)
1059464
public function askCommand(): void
    {
        $a = Interact::ask('you name is: ', '', function ($val, &$err) {
            if (!preg_match('/^\w{2,}$/', $val)) {
                $err = 'Your input must match /^\w{2,}$/';
                return false;
            }

            return true;
        });

        $this->write('Your answer is: ' . $a);
    }
239730
def send_response(self, code, message=None):
        """"""
        self.log_request(code)
        if message is None:
            message = code in self.responses and self.responses[code][0] or ""
        if self.request_version != "HTTP/0.9":
            hdr = "%s %d %s\r\n" % (self.protocol_version, code, message)
            self.wfile.write(hdr.encode("ascii"))