Usage:

helper.after();

Sets up a mocha "after" function for the describe block in a spec that
does the relevant shutdown of core services.
191980
function (callback) {
        after("helper.after", function () {
            return bluebird.resolve()
                .then(function() {
                    if (_.isFunction(callback)) {
                        return callback();
                    }
                })
                .then(helper.stop.bind(helper));
        });
    }
151983
function (callback) {
                var self = this;
                flow()
                    .seq(function (cb) {
                        self.$handlers.stop(function () {
                            // ignore errors during stop
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$authenticationService.stop(function () {
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$filters.stop(function () {
                            // ignore errors during stop
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$endPoints.shutdown(function () {
                            // ignore errors during shutdown
                            cb();
                        });
                    })
                    .exec(function (err) {
                        callback && callback(err);

                        process.stdin.end();
                    });
            }
508687
@AfterStory(uponGivenStory = false)
  public void cleanUp() {
    LOG.debug("Cleaning up after story run.");
    Mocks.reset();
    support.undeploy();
    support.resetClock();
    ProcessEngineAssertions.reset();
  }
430904
def after_request(response)
      @response = HTTParty::Response.new(self, response, -> { HTTParty::Parser.new(response.body, Jiralicious::Session.format).parse }, body: response.body)
    end
1212917
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
		// Stop view stopwatch
		stopStopwatch();

		// Remove location
		threadLocation.remove();
	}
751991
private function after(callable $after): void
    {
        if ($after instanceof Closure) {
            $this->options["after"] = $after->bindTo($this);
        } else {
            $this->options["after"] = $after;
        }
    }
463191
def postActivate_(self):
        
        self.analyzer = LicensePlateDetector(**self.analyzer_pars) # this is called after the fork (i.e. after the multiprocess has been spawned)
        self.report("analyzer object=", self.analyzer)
634058
def post_run(self, outline=False, *args, **kwargs):
        """"""
        post_destroy = self.context.config.post_destroy
        if not outline and post_destroy:
            util.handle_hooks(
                stage="post_destroy",
                hooks=post_destroy,
                provider=self.provider,
                context=self.context)
1216859
function finalizeBuildOnce(config, data, callback) {
  maybeDisableMockjax();
  let options = {
    xhr: getNativeXhr,
    method: 'POST',
    // Use "async: false" to block the browser from shutting down until the finalize_build call
    // has fully returned. This prevents testem from shutting down the express server until
    // our middleware has finished uploading resources and resolving promises.
    async: false,
    timeout: 30000,
  };
  percyJQuery.ajax('/_percy/finalize_build', options)
    .done( () => {
      if(callback) {
        callback();
      }
    });
  maybeResetMockjax();
}
592878
function done() {
      res.removeListener('finish', onfinish);
      res.removeListener('close', onclose);
      /* eslint no-underscore-dangle: 0 no-param-reassign: 0 */
      ctx.response._startAt = process.hrtime();
      try {
        const line = formatLine(morgan, ctx);
        /* eslint no-console:0 */
        console.info(line);
      } catch (err) {
        /* eslint no-console:0 */
        /* istanbul ignore next */
        console.error(err);
      }
    }
1046964
@Override
    protected void after() {
        super.after();
        if (adminSession != null) {
            LOG.info("Logging off {}", adminSession.getUserID());
            adminSession.logout();
            adminSession = null;
        }
        if (anonSession != null) {
            LOG.info("Logging off {}", anonSession.getUserID());
            anonSession.logout();
            anonSession = null;
        }
        for (final Session session : userSessions.values()) {
            LOG.info("Logging off {}", session.getUserID());
            session.logout();
        }
        userSessions.clear();
        LOG.info("Closed all sessions");
    }
885716
function after (count, callback, context) {
  var runCount = 0
  var rests = []
  context = context || this
  return function () {
    runCount++
    if (runCount <= count) {
      rests.push(arguments[0])
    }
    if (runCount >= count) {
      callback.apply(context, [rests].concat(arraySlice(arguments)))
    }
  }
}
675460
def on_finish(self, func):
        '''
        '''
        if self._done.is_set():
            if self._failure is None:
                backend.schedule(func, args=(self._value,))
        else:
            self._cbacks.append(func)
167561
function(args, callInstance) {
    handlers.afterFunc({name: callInstance.name}, null, args, callInstance);
  }
1315725
function serve(done) {
  gulp.watch(['src/**/*.css'], () => {
    reset();
    gulp.series('build-css', 'generate-preview', outputDevServerInfo);
  });

  gulp.watch(['previewer-src/**', 'patterns.yaml'], () => {
    reset();
    gulp.series('generate-preview-force', outputDevServerInfo)
  });

  browserSync.emitter.on('init', outputDevServerInfo);

  browserSync.init({
    logLevel: 'silent',
    ui: false,
    port: 4321,
    notify: false,
    server: {
      baseDir: __dirname + '/build',
      middleware: [historyApiFallback()],
    },
    startPath: '/',
    open: false
  });
}
824278
protected function setAfterDeleteRoute()
    {
        parent::setAfterDeleteRoute();

        if ($this->afterSaveRouteUrl) {
            $this->afterSaveRouteUrl[\Gems_Model::APPOINTMENT_ID] = $this->request->getParam(\Gems_Model::APPOINTMENT_ID);
        }
    }
31882
def after(self, func):
        
        ns = self.Namespace()
        ns.times = self.obj

        if ns.times <= 0:
            return func()

        def work_after(*args):
            if ns.times <= 1:
                return func(*args)
            ns.times -= 1

        return self._wrap(work_after)