command.on_success do |value|
   ...
 end
354162
def on_success(&block)
      on do |_, value, reason|
        block.call(value) unless reason
      end
    end
574656
function () {
            var match = this._parser.exec(this._content);
            if (!match) {
                return false;    // Stop parsing
            }
            this._addValue(match);
            return this._checkAfterValue(match);
        }
155117
def handle(self, *args, **options):
        
        counter = 0
        for key in options:
            if options[key]:
                counter += 1

        # If no options are set, do a normal patch
        if counter == 1:
            options['default'] = True
        ###########################################################################################

        tag_succeed = 1

        if APISettings.GIT_TAG_AUTO_COMMIT:
            Git.add()
            Git.commit()

        if options['default']:
            tag_succeed = Git.tag()

        if options['staging']:
            tag_succeed = Git.tag(APISettings.GIT_STAGING_PRE_TAG)

        if options['production']:
            tag_succeed = Git.tag(APISettings.GIT_ACTIVATE_PRE_TAG)

        if options['push'] | APISettings.GIT_TAG_AUTO_TAG_PUSH:
            if tag_succeed:
                Git.push_tags()
5446
def on_command_call(*args)
    if args.last && :args == args.last[0]
      args_add = args.pop
      call = on_call(*args)
      on_method_add_arg(call, args_add)
    else
      super
    end
  end
520445
function _sendResult(state, err, args, str) {
    _unbindKeypress(state);
    state.rl.close();

    // At this point, we should be able to parse a closed command. If not, something is not right
    return state.callback(err, _.pluck(_getFinalArguments(args), 'str'), str);
}
1352737
def _on_loop_end(self, variables):
        
        for callback in self.callbacks:
            if hasattr(callback, 'on_loop_end'):
                self.logs_[str(callback)].append(callback.on_loop_end(**variables))
756277
def handle_command(command):
  
  try:
    cmds = command.split(None, 1)
    cmd = cmds[0]
    if cmd == 'new':
      add_task(get_arg(cmds))
    elif cmd == 'done':
      mark_done(int(get_arg(cmds)))
    elif cmd == 'list':
      for task in format_tasks(list_tasks()):
        print task
    elif cmd == 'delete':
      delete_task(int(get_arg(cmds)))
    else:
      print_usage()
  except Exception, e:  # pylint: disable=broad-except
    print e
    print_usage()
743619
def finish(self, value):
        '''
        '''
        if self._done.is_set():
            raise errors.AlreadyComplete()

        self._value = value

        for cb in self._cbacks:
            backend.schedule(cb, args=(value,))
        self._cbacks = None

        for wait in list(self._waits):
            wait.finish(self)
        self._waits = None

        for child in self._children:
            child = child()
            if child is None:
                continue
            child._incoming(self, value)
        self._children = None

        self._done.set()
921330
function done( error, results ) {
		if ( error ) {
			return clbk( error );
		}
		if ( results ) {
			return clbk( null, results );
		}
		clbk();
	}
209950
function success(result, ignore) {
    return ((typeof result.error === 'undefined' &&
        typeof result.status === 'undefined' &&
        typeof result.success === 'undefined') ||
        (result.status && result.status === 'success') ||
        (result.success && result.success === true) ||
        (ignore && result.error && !ignore.test(result.error))) ? true : false;
}
1054948
def finish(self):
        ''

        self.finished = True
        self.update(self.maxval)
        self.fd.write('\n')
        if self.signal_set:
            signal.signal(signal.SIGWINCH, signal.SIG_DFL)

        if self.redirect_stderr:
            self._stderr.write(sys.stderr.getvalue())
            sys.stderr = self._stderr

        if self.redirect_stdout:
            self._stdout.write(sys.stdout.getvalue())
            sys.stdout = self._stdout
191794
function end () {
          console.log('\n=== REG DUMP ===\n' + cpu.regdump().join('\n'))
          if (options.memDump) console.log('\n\n=== MEM DUMP ===\n' + cpu.memdump(0, 65535).join('\n'))
          process.exit() // workaround for stdin event listener hanging
        }
709181
def succeed(self, text=None):
        
        return self.stop_and_persist(symbol=LogSymbols.SUCCESS.value, text=text)
302015
function end (input, value) {
  if (value != null) input.push(String(value))
  input.push(null)
}
150810
function _end(debug) {

  const DEBUG_FIELDS = ['exitcode', 'output', 'stdout', 'stderr'];

  var summary = util.format(
    '%d test%s, %d success%s, %d failure%s',
    successes.length + failures.length,
    (successes.length + failures.length > 1) ? 's' : '',
    successes.length,
    (successes.length > 1) ? 'es' : '',
    failures.length,
    (failures.length > 1) ? 's' : ''
  );

  console.log('');

  if (failures.length === 0) {
    console.log(summary.green);

  } else {

    failures.forEach(function (failure) {
      console.error(util.format('' +
          '\n----------------' +
          '\n%s%s' +
          '\n%s',
        failure.test.description ? failure.test.description + '\n' : '',
        failure.test.file.cyan,
        failure.test.command));

      failure.errors.forEach(function (error) {
        console.error(error.red);
      });

      if (debug) {
        console.error('exec dir: %s\n'.grey, failure.test.dir);

        DEBUG_FIELDS.forEach(function (field) {
          if (failure.test[field]) {
            console.error('%s: %s\n'.grey, field, failure.result[field]);
          }
        });
      }
    });

    console.error(summary.red);
  }

}
914190
function (success, fail, args, env) {
	var result = new PluginResult(args, env);

	result.ok(keyboard.getInstance().startService(), false);
	}
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)