Sign up, run the ``participate`` method, then sign off and close
        the driver.
968830
def run_experiment(self):
        """"""
        try:
            self.sign_up()
            self.participate()
            if self.sign_off():
                self.complete_experiment("worker_complete")
            else:
                self.complete_experiment("worker_failed")
        finally:
            self.driver.quit()
1127548
public void logout() {
        saveResumeToken(null);
        mDDPState = DDPSTATE.NotLoggedIn;
        mUserId = null;
        broadcastConnectionState(mDDPState);
    }
902086
def sign_out(resource_or_scope)
      scope = Devise::Mapping.find_scope!(resource_or_scope)
      warden.user(scope) # Without loading user here, before_logout hook is not called
      warden.raw_session.inspect # Without this inspect here. The session does not clear.
      warden.logout(scope)
      # user id   
      post_signout scope            
    end
225392
async def on_shutdown(self):
        
        await self._unregister_subscriptions()

        self._accepting = False

        for (ws, _) in self._subscribers:
            await ws.close(code=aiohttp.WSCloseCode.GOING_AWAY,
                           message='Server shutdown')
1201840
def close(self):
        
        if self.ipmi_session:
            self.ipmi_session.unregister_keepalive(self.keepaliveid)
        if self.activated:
            try:
                self.ipmi_session.raw_command(netfn=6, command=0x49,
                                              data=(1, 1, 0, 0, 0, 0))
            except exc.IpmiException:
                # if underlying ipmi session is not working, then
                # run with the implicit success
                pass
837264
function signup(){
    console.log('signup called');

    var name = document.getElementById('signup-name').value;
    var username = document.getElementById('signup-username').value;
    var email = document.getElementById('signup-email').value;
    var password = document.getElementById('signup-password').value;

    grout.signup().then(function(){
      console.log('successful logout');
      setStatus();
    }, function(err){
      console.error('logout() : Error logging out:', err);
    });
  }
1237412
protected function registerCloseCallback()
    {
        $this->swooleServer->on('Close', function ($server, $fd, $reactorId) {
            $this->dispatchEvent('Close', $this, $fd, $reactorId);
        });
    }
607620
def quit(self):
    """"""
    try:
      # Don't expect a response.
      self._client.write(sc_pb.Request(quit=sc_pb.RequestQuit()))
    except protocol.ConnectionError:
      pass  # It's likely already (shutting) down, so continue as if it worked.
    finally:
      self.close()
931089
def logout_listener(app, user):
    
    @after_this_request
    def _commit(response=None):
        if hasattr(session, 'sid_s'):
            delete_session(session.sid_s)
        # Regenerate the session to avoid session fixation vulnerabilities.
        session.regenerate()
        current_accounts.datastore.commit()
        return response
1244190
def close(self):
        """"""
        if not self.driver:
            return

        try:
            self.driver.implicitly_wait(1)
            self.driver.find_element_by_id('link-logout').click()
        except NoSuchElementException:
            pass

        self.driver.quit()
        self.driver = None
1193361
function exit()
{
	if (my_MotorDriver_obj)
	{
		my_MotorDriver_obj = null;
		MotorDriver_lib.cleanUp();
	}
	MotorDriver_lib = null;
	console.log("Exiting");
	process.exit(0);	
}
207865
def sign_up(self):
        
        self.log("Bot player signing up.")
        self.subscribe_to_quorum_channel()
        while True:
            url = (
                "{host}/participant/{self.worker_id}/"
                "{self.hit_id}/{self.assignment_id}/"
                "debug?fingerprint_hash={hash}&recruiter=bots:{bot_name}".format(
                    host=self.host,
                    self=self,
                    hash=uuid.uuid4().hex,
                    bot_name=self.__class__.__name__,
                )
            )
            try:
                result = requests.post(url)
                result.raise_for_status()
            except RequestException:
                self.stochastic_sleep()
                continue

            if result.json()["status"] == "error":
                self.stochastic_sleep()
                continue

            self.on_signup(result.json())
            return True
740683
def exit(self, status=0, message=None):
        
        if message:
            raise HelpBanner(message.strip(), code=status)
464090
def deactivate(self):
        
        if self._driver and self._driver.is_connected():
            self._driver.deactivate()
1115920
def handle_quit(self, connection, event):
        
        nickname = self.get_nickname(event)
        self.quit[nickname] = datetime.now()
        del self.joined[nickname]
618038
function _closeOnSignal(signal) {
    process.on(signal, onSignal);

    /**
     * @returns {void}
     */
    function onSignal() {
      logger.info({ workerName: configuration.workerName, signal },
        '[worker#listen] Received exit signal, stopping workers...');
      workers.close(true);
    }
  }
129349
public function signOff()
    {
        if ($virtualUserId = input()->cookie('ssid')) {
            $cacheItemPool = $this->getCacheItemPool();
            $cacheItemPool->deleteItem('sso-' . $virtualUserId);
            delete_cookie('ssid');
        }
    }