:type sessionState: SessionState
        :type sessionVersion: int
        :type parameters: BobAxolotlParameters
507553
def initializeSessionAsBob(sessionState, sessionVersion, parameters):
        
        sessionState.setSessionVersion(sessionVersion)
        sessionState.setRemoteIdentityKey(parameters.getTheirIdentityKey())
        sessionState.setLocalIdentityKey(parameters.getOurIdentityKey().getPublicKey())

        secrets = bytearray()

        if sessionVersion >= 3:
            secrets.extend(RatchetingSession.getDiscontinuityBytes())

        secrets.extend(Curve.calculateAgreement(parameters.getTheirIdentityKey().getPublicKey(),
                                                parameters.getOurSignedPreKey().getPrivateKey()))

        secrets.extend(Curve.calculateAgreement(parameters.getTheirBaseKey(),
                                                parameters.getOurIdentityKey().getPrivateKey()))
        secrets.extend(Curve.calculateAgreement(parameters.getTheirBaseKey(),
                                                parameters.getOurSignedPreKey().getPrivateKey()))

        if sessionVersion >= 3 and parameters.getOurOneTimePreKey() is not None:
            secrets.extend(Curve.calculateAgreement(parameters.getTheirBaseKey(),
                                                    parameters.getOurOneTimePreKey().getPrivateKey()))

        derivedKeys = RatchetingSession.calculateDerivedKeys(sessionVersion, secrets)
        sessionState.setSenderChain(parameters.getOurRatchetKey(), derivedKeys.getChainKey())
        sessionState.setRootKey(derivedKeys.getRootKey())
146542
def state(self):
        
        return dict(
            (attr, getattr(self, attr))
            for attr in (
                'consumer_key', 'consumer_secret', 'callback_uri',
                'verified', 'oauth_token', 'oauth_token_secret',
                'oauth_session_handle', 'oauth_expires_at',
                'oauth_authorization_expires_at', 'scope'
            )
            if getattr(self, attr) is not None
        )
835751
public void sessionAttributeSet(ISession source, Object key, Object oldValue, Boolean oldIsListener, Object newValue, Boolean newIsListener) {
        // ArrayList sessionStateObservers = null;

        /*
         * Check to see if there is a non-empty list of sessionStateObservers.
         */
        if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) {
            return;
        }

        // synchronized(_sessionStateObservers) {
        // sessionStateObservers = (ArrayList)_sessionStateObservers.clone();
        // }

        ISessionStateObserver sessionStateObserver = null;
        for (int i = 0; i < _sessionStateObservers.size(); i++) {
            sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i);
            sessionStateObserver.sessionAttributeSet(source, key, oldValue, oldIsListener, newValue, newIsListener);
        }
    }
480066
def register_on_session_state_changed(self, callback):
        
        event_type = library.VBoxEventType.on_session_state_changed
        return self.event_source.register_callback(callback, event_type)
896800
def get_current_session(request, hproPk):
    """"""

    retour = {}

    base_key = 'plugit_' + str(hproPk) + '_'

    for key, value in request.session.iteritems():
        if key.startswith(base_key):
            retour[key[len(base_key):]] = value

    return retour
174520
public int setState(boolean bState, boolean bDisplayOption, int iMoveMode)
    {
        Boolean objData = new Boolean(bState);
        if (this.getDataClass() == Boolean.class)
            return this.setData(objData, bDisplayOption, iMoveMode);
        else if (Number.class.isAssignableFrom(this.getDataClass()))
            return this.setValue(objData.booleanValue() ? 1 : 0, bDisplayOption, iMoveMode);
        else if (this.getDataClass() == String.class)
            return this.setString(objData.booleanValue() ? Constants.TRUE : Constants.FALSE, bDisplayOption, iMoveMode);
        return super.setState(bState, bDisplayOption, iMoveMode);
    }
975068
def setBehaviorFromVersionLine(self, versionLine):
        
        v = getBehavior(self.name, versionLine.value)
        if v:
            self.setBehavior(v)
405026
def get_param(self):
        
        return dict(userName=self.username, sessionId=self.session_id, database=self.database)
343203
public ClientSessionState setState(Session.State state) {
    if (state != Session.State.UNSTABLE) {
      if (this.state != state) {
        return setStateAndCallListeners(state);
      }
    } else {
      if (this.state == Session.State.UNSTABLE) {
        if (unstabilityTimeout > 0 && (System.currentTimeMillis() - unstableSince) > unstabilityTimeout) {
          return setStateAndCallListeners(Session.State.STALE);
        }
      } else if (this.state != Session.State.STALE) {
        unstableSince = System.currentTimeMillis();
        return setStateAndCallListeners(state);
      }
    }

    return this;
  }
279321
public void sessionExpiryTimeSet(ISession session, long old, long newone) {
        // ArrayList sessionStateObservers = null;

        /*
         * Check to see if there is a non-empty list of sessionStateObservers.
         */
        if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) {
            return;
        }

        // synchronized(_sessionStateObservers) {
        // sessionStateObservers = (ArrayList)_sessionStateObservers.clone();
        // }

        ISessionStateObserver sessionStateObserver = null;
        for (int i = 0; i < _sessionStateObservers.size(); i++) {
            sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i);
            sessionStateObserver.sessionExpiryTimeSet(session, old, newone);
        }
    }
553703
def currentVersion(self):
        
        if self._currentVersion is None:
            self.__init(self._url)
        return self._currentVersion
594306
public void sessionAttributeRemoved(ISession source, Object key, Object value, Boolean oldIsBindingListener) {
        // ArrayList sessionStateObservers = null;

        /*
         * Check to see if there is a non-empty list of sessionStateObservers.
         */
        if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) {
            return;
        }

        // synchronized(_sessionStateObservers) {
        // sessionStateObservers = (ArrayList)_sessionStateObservers.clone();
        // }

        ISessionStateObserver sessionStateObserver = null;
        for (int i = 0; i < _sessionStateObservers.size(); i++) {
            sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i);
            sessionStateObserver.sessionAttributeRemoved(source, key, value, oldIsBindingListener);
        }

    }
196399
@Override
  @SuppressWarnings("unchecked")
  public void stateChanged(AppSession source, Enum oldState, Enum newState) {
    logger.info("Diameter Rf SessionFactory :: stateChanged :: source[{}], oldState[{}], newState[{}]", new Object[] { source, oldState, newState });
  }
1108819
public void sessionAttributeSet(ISession session, Object name, Object oldValue, Boolean oldIsListener, Object newValue, Boolean newIsListener) {

        HttpSession httpsession = (HttpSession) _adapter.adapt(session);
        HttpSessionBindingEvent addEvent = null; // only init if necessary
        HttpSessionBindingEvent replaceEvent = null; // only init this if
                                                     // necessary..done below

        // do binding listeners first to be consistent with v6.1
        if ((oldValue != null) && (oldIsListener.booleanValue())) {
            replaceEvent = new HttpSessionBindingEvent(httpsession, (String) name, oldValue);
            // if (oldValue instanceof HttpSessionBindingListener)
            ((HttpSessionBindingListener) oldValue).valueUnbound(replaceEvent);
        }
        if ((newValue != null) && (newIsListener.booleanValue())) { // (newValue instanceof HttpSessionBindingListener) ) {
            addEvent = new HttpSessionBindingEvent(httpsession, (String) name, newValue);
            ((HttpSessionBindingListener) newValue).valueBound(addEvent);
        }
    }
188471
@Override
	public List<RecordSessionUrl> getUrlsForType (int type) throws DatabaseException {
    	SqlPreparedStatementWrapper psGetAlluRLSForType = null;
        try {
        	psGetAlluRLSForType = DbSQL.getSingleton().getPreparedStatement("sessionurl.ps.geturlsfortype");
			psGetAlluRLSForType.getPs().setInt(1, type);
			try (ResultSet rs = psGetAlluRLSForType.getPs().executeQuery()) {
				List<RecordSessionUrl> result = new ArrayList<>();
				while (rs.next()) {
					result.add(new RecordSessionUrl(rs.getLong(URLID), rs.getInt(TYPE), rs.getString(URL)));
				}
				return result;
			}
		} catch (SQLException e) {
			throw new DatabaseException(e);
		} finally {
			DbSQL.getSingleton().releasePreparedStatement(psGetAlluRLSForType);
		}
    }
1282467
def session_to_epoch(timestamp):
    
    utc_timetuple = datetime.strptime(timestamp, SYNERGY_SESSION_PATTERN).replace(tzinfo=None).utctimetuple()
    return calendar.timegm(utc_timetuple)
949485
def initializeSessionAsAlice(sessionState, sessionVersion, parameters):
        
        sessionState.setSessionVersion(sessionVersion)
        sessionState.setRemoteIdentityKey(parameters.getTheirIdentityKey())
        sessionState.setLocalIdentityKey(parameters.getOurIdentityKey().getPublicKey())

        sendingRatchetKey = Curve.generateKeyPair()
        secrets = bytearray()

        if sessionVersion >= 3:
            secrets.extend(RatchetingSession.getDiscontinuityBytes())

        secrets.extend(Curve.calculateAgreement(parameters.getTheirSignedPreKey(),
                                                parameters.getOurIdentityKey().getPrivateKey()))
        secrets.extend(Curve.calculateAgreement(parameters.getTheirIdentityKey().getPublicKey(),
                                                parameters.getOurBaseKey().getPrivateKey()))
        secrets.extend(Curve.calculateAgreement(parameters.getTheirSignedPreKey(),
                                                parameters.getOurBaseKey().getPrivateKey()))

        if sessionVersion >= 3 and parameters.getTheirOneTimePreKey() is not None:
            secrets.extend(Curve.calculateAgreement(parameters.getTheirOneTimePreKey(),
                                                    parameters.getOurBaseKey().getPrivateKey()))

        derivedKeys = RatchetingSession.calculateDerivedKeys(sessionVersion, secrets)
        sendingChain = derivedKeys.getRootKey().createChain(parameters.getTheirRatchetKey(), sendingRatchetKey)

        sessionState.addReceiverChain(parameters.getTheirRatchetKey(), derivedKeys.getChainKey())
        sessionState.setSenderChain(sendingRatchetKey, sendingChain[1])
        sessionState.setRootKey(sendingChain[0])