Trigger the before first request methods.
769972
async def try_trigger_before_first_request_functions(self) -> None:
        """"""
        if self._got_first_request:
            return

        # Reverse the teardown functions, so as to match the expected usage
        self.teardown_appcontext_funcs = list(reversed(self.teardown_appcontext_funcs))
        for key, value in self.teardown_request_funcs.items():
            self.teardown_request_funcs[key] = list(reversed(value))
        for key, value in self.teardown_websocket_funcs.items():
            self.teardown_websocket_funcs[key] = list(reversed(value))

        async with self._first_request_lock:
            if self._got_first_request:
                return
            for function in self.before_first_request_funcs:
                await function()
            self._got_first_request = True
1374032
function ajaxBeforeSend(xhr, settings) {
        var context = settings.context;
        if (settings.beforeSend.call(context, xhr, settings) === false || triggerGlobal(settings, context, 'ajaxBeforeSend', [
                xhr,
                settings
            ]) === false)
            return false;

        triggerGlobal(settings, context, 'ajaxSend', [
            xhr,
            settings
        ]);
    }
807197
def _EnsureRequesterStarted(self):
    """"""
    if not self._analyzer_started:
      self._analyzer.start()
      self._analyzer_started = True
850240
def pre_request(self):
        
        middleware = sort_by_priority(self)
        return tuple(m.pre_request for m in middleware if hasattr(m, 'pre_request'))
461912
public void onStartup() {
        try {
            preloadCaches();
            SpringAppContext.getInstance().loadPackageContexts();  // trigger dynamic context loading
            preloadDynamicCaches();
            // implementor cache relies on kotlin from preloadDynamicCaches()
            ImplementorCache implementorCache = new ImplementorCache();
            implementorCache.loadCache();
            allCaches.put(ImplementorCache.class.getSimpleName(), implementorCache);
        }
        catch (Exception ex){
            String message = "Failed to load caches";
            logger.severeException(message, ex);
            throw new StartupException(message, ex);
        }
    }
918438
protected function beforeUpdate()
    {
        $this->dispatcher->getEventsManager()->fire(Events::BEFORE_UPDATE, $this);
        $this->beforeSave();
    }
241816
protected boolean trigger(ServletRequest pRequest) {
        boolean trigger = false;

        if (pRequest instanceof HttpServletRequest) {
            HttpServletRequest request = (HttpServletRequest) pRequest;
            String accept = getAcceptedFormats(request);
            String originalFormat = getServletContext().getMimeType(request.getRequestURI());

            //System.out.println("Accept: " + accept);
            //System.out.println("Original format: " + originalFormat);

            // Only override original format if it is not accpeted by the client
            // Note: Only explicit matches are okay, */* or image/* is not.
            if (!StringUtil.contains(accept, originalFormat)) {
                trigger = true;
            }
        }

        // Call super, to allow content negotiation even though format is supported
        return trigger || super.trigger(pRequest);
    }
1366074
function injectBefore(replServer, method, beforeFn) {
  var _orig = replServer[method];
  replServer[method] = function() {
    var args = Array.prototype.slice.call(arguments);
    var callback = args.pop();
    beforeFn.apply(null, args.concat(function(err, res) {
      if (err || res) {
        callback(err, res);
      } else {
        _orig.apply(replServer, args.concat(callback));
      }
    }));
  };
  return replServer;
}
351572
@Override
   public void prefill()
   {
      if (isShutdown())
         return;

      if (poolConfiguration.isPrefill())
      {
         ManagedConnectionPool mcp = pools.get(getPrefillCredential());

         if (mcp == null)
         {
            // Trigger the initial-pool-size prefill by creating the ManagedConnectionPool
            getManagedConnectionPool(getPrefillCredential());
         }
         else
         {
            // Standard prefill request
            mcp.prefill();
         }
      }
   }
1075275
public function onBefore(BeforeEvent $event)
    {
        $request = $event->getRequest();

        if (!$this->canCacheRequest($request)) {
            $this->cacheMiss($request);
            return;
        }

        if (!($response = $this->storage->fetch($request))) {
            $this->cacheMiss($request);
            return;
        }

        $response->setHeader('Age', Utils::getResponseAge($response));
        $valid = $this->validate($request, $response);

        // Validate that the response satisfies the request
        if ($valid) {
            $request->getConfig()->set('cache_lookup', 'HIT');
            $request->getConfig()->set('cache_hit', true);
            $event->intercept($response);
        } else {
            $this->cacheMiss($request);
        }
    }
659700
protected void fireBeforePersist() {
        PersistableListener l = _listener;
        
        if(l != null) {
            try {
                l.beforePersist();
            } catch(Exception e) {
                _log.error("failure on calling beforePersist", e);
            }
        }
    }
549539
private void triggerQueuedRequests() {
		if (triggerRequestQueued) {
			triggerRequestQueued = false;

			// trigger the checkpoint from the trigger timer, to finish the work of this thread before
			// starting with the next checkpoint
			if (periodicScheduling) {
				if (currentPeriodicTrigger != null) {
					currentPeriodicTrigger.cancel(false);
				}
				currentPeriodicTrigger = timer.scheduleAtFixedRate(
						new ScheduledTrigger(),
						0L, baseInterval, TimeUnit.MILLISECONDS);
			}
			else {
				timer.execute(new ScheduledTrigger());
			}
		}
	}
1202435
public void startup(@Observes(precedence = -100) final BeforeSuite event) {
        if (extensionEnabled()) {
            debug("Catching BeforeSuite event {0}", event.toString());
            executeInClassScope(new Callable<Void>() {
                @Override
                public Void call() {
                    generateDeploymentEvent.fire(new GenerateDeployment(new TestClass(deploymentClass)));
                    suiteDeploymentScenario = classDeploymentScenario.get();
                    return null;
                }
            });
            deployDeployments = true;
            extendedSuiteContext.get().activate();
            suiteDeploymentScenarioInstanceProducer.set(suiteDeploymentScenario);
        }
    }
898559
protected function triggerBeforeCreationEvent()
    {
        $event = new LdapObjectCreationEvent(Event::LDAP_OBJECT_BEFORE_CREATE, $this->schema ? $this->schema->getObjectType() : null);
        $event->setData($this->attributes);
        $event->setContainer($this->container);
        $event->setDn($this->dn);

        $this->dispatcher->dispatch($event);

        $this->attributes = $event->getData();
        $this->container = $event->getContainer();
        $this->dn = $event->getDn();
    }
1008150
protected void beforeSend(RpcInternalContext context, SofaRequest request) {
        currentRequests.incrementAndGet();
        context.getStopWatch().tick().read();
        context.setLocalAddress(localAddress());
        if (EventBus.isEnable(ClientBeforeSendEvent.class)) {
            EventBus.post(new ClientBeforeSendEvent(request));
        }
    }
257313
private void doBefore() throws Throwable { //NOSONAR

        this.repository = this.createRepository();
        doStateTransition(State.CREATED);
        this.initialize();
        doStateTransition(State.INITIALIZED);
    }
1043636
protected function beforeRequest()
    {
        if ($this->recreateApplication) {
            $this->resetApplication();
            return;
        }

        $application = $this->getApplication();

        $this->resetResponse($application);
        $this->resetRequest($application);

        $definitions = $application->getComponents(true);
        foreach ($this->recreateComponents as $component) {
            // Only recreate if it has actually been instantiated.
            if ($application->has($component, true)) {
                $application->set($component, $definitions[$component]);
            }
        }
    }