To be used once only, when creating the session.
773109
public void attachPipe(Pipe pipe)
    {
        assert (!isTerminating());
        assert (this.pipe == null);
        assert (pipe != null);
        this.pipe = pipe;
        this.pipe.setEventSink(this);
    }
699877
@Override
    public void sessionCreated(HttpSessionEvent event) {

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "HttpSession created: HttpSession ID: " + event.getSession().getId());
        }
        // nothing to do here, since later the code will add the session id to a map 

    }
206327
def create_session(self, username, prekeybundle, autotrust=False):
        
        logger.debug("create_session(username=%s, prekeybunder=[omitted], autotrust=%s)" % (username, autotrust))
        session_builder = SessionBuilder(self._store, self._store, self._store, self._store, username, 1)
        try:
            session_builder.processPreKeyBundle(prekeybundle)
        except UntrustedIdentityException as ex:
            if autotrust:
                self.trust_identity(ex.getName(), ex.getIdentityKey())
            else:
                raise exceptions.UntrustedIdentityException(ex.getName(), ex.getIdentityKey())
828431
def once(ctx, name):
    """"""
    from kibitzr.app import Application
    app = Application()
    sys.exit(app.run(once=True, log_level=ctx.obj['log_level'], names=name))
22489
@Override
    public Session createSession() throws JMSException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createSession");

        Session session = null;
        try {
            session = createSession(false, Session.AUTO_ACKNOWLEDGE);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createSession");
        }

        return session;
    }
402161
def _init_session(self, session):
        # type: (requests.Session) -> None
        
        _patch_redirect(session)

        # Change max_retries in current all installed adapters
        max_retries = self.config.retry_policy()
        for protocol in self._protocols:
            session.adapters[protocol].max_retries = max_retries
472770
void registerSessionIfNeeded(HttpSession session) {
		if (session != null) {
			synchronized (session) {
				if (!SESSION_MAP_BY_ID.containsKey(session.getId())) {
					sessionCreated(new HttpSessionEvent(session));
				}
			}
		}
	}
766745
protected static void checkCreateSession ()
    {
        if (_defaultSession == null) { // no need to sync
            Properties props = System.getProperties();
            if (props.getProperty("mail.smtp.host") == null) {
                props.put("mail.smtp.host", "localhost");
            }
            _defaultSession = Session.getDefaultInstance(props, null);
        }
    }
265108
@SuppressWarnings("unchecked")
	public void sessionCreated(HttpSessionEvent se) {
		Descriptor<? extends Context> descriptor = container.contexts().get(Session.class);
		
		if (descriptor != null) {
			WebContext<HttpSession> context = (WebContext<HttpSession>) container.component(descriptor);
			context.associate(se.getSession());
		}
	}
465491
public void initFormForSession(
        final String sessionId,
        final Element formElement,
        final I_CmsClientCmsUgcSessionCallback onSuccess,
        final I_CmsErrorCallback onError) {

        getRpcHelper().executeRpc(SERVICE.getContent(new CmsUUID(sessionId), new AsyncCallback<CmsUgcContent>() {

            public void onFailure(Throwable caught) {

                handleError(caught, onError);
            }

            public void onSuccess(CmsUgcContent result) {

                CmsClientUgcSession session = new CmsClientUgcSession(CmsXmlContentUgcApi.this, result);
                session.initFormElement(formElement);
                onSuccess.call(session);
            }
        }));
    }
278632
public void createSession(Session session) {
        sessionMap.put(session.id(), session);
        Event event = new Event();
        event.attribute("session", session);

        eventManager.fireEvent(EventType.SESSION_CREATED, event);
    }
43441
def _initialize_session():
    # type: () -> None
    
    sys_random = random.SystemRandom()
    _thread_local_storage.secret_key = b''.join(
        int2byte(sys_random.randint(0, 255))
        for _ in range(SECRET_KEY_BITS // 8))
611783
def _create_session(self):
        
        self.driver = webdriver.Chrome(chrome_options=self.opts, **self.driver_args)
        self.driver.set_window_size(1920, 1080)
999599
protected function setUpSession () {
		if ($this->session === NULL) {
			$sessionClass = $this->application->GetSessionClass();
			$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
			$this->session = $sessionClass::GetNamespace($selfClass);
			$this->session->SetExpirationSeconds($this->sessionExpirationSeconds);
		}
	}
1143501
def once(self, event, callback):
        ''
        self._once_events.add(event)
        self.on(event, callback)
939359
def _make_session():
        

        sess = requests.Session()
        sess.mount('http://', requests.adapters.HTTPAdapter(max_retries=False))
        sess.mount('https://', requests.adapters.HTTPAdapter(max_retries=False))

        return sess
151967
def in_session(self):
        """"""
        session = self.get_session()
        try:
            yield session
            session.commit()
        except IntegrityError:
            session.rollback()
            raise DuplicateError("Duplicate unique value detected!")
        except (OperationalError, DisconnectionError):
            session.rollback()
            self.close()
            logger.warn("Database Connection Lost!")
            raise DatabaseConnectionError()
        except Exception:
            session.rollback()
            raise
        finally:
            session.close()