Wrap getting a key from the session
330092
public static function wrapped_session_get($session_object,$key,$default=null)
    {
        global $TSUGI_SESSION_OBJECT;
        if ( $session_object === null && isset($TSUGI_SESSION_OBJECT) ) $session_object = $TSUGI_SESSION_OBJECT;
        if ( is_object($session_object) ) {
            return $session_object->get($key,$default);
        }
        if ( is_array($session_object) ) {
            if ( isset($session_object[$key]) ) return $session_object[$key];
            return $default;
        }
        if ( ! isset($_SESSION) ) return $default;
        if ( ! isset($_SESSION[$key]) ) return $default;
        return $_SESSION[$key];
    }
1072881
function getSession(apiKey) {
  var session = Sessions.get(apiKey)

  if (session) return session

  session = new Session()
  Sessions.set(apiKey, session)

  return session
}
902329
function fetch(conf, key, fn) {
  getKey(conf, key, function(err, layout) {
    if (err) return fn(err);
    get(layout, fn);
  });
}
782426
@SuppressWarnings("unchecked")
    public static <T> T getSessionAttribute(final HttpSession session, final String key) {
        if (session != null) {
            return (T) session.getAttribute(key);
        }
        return null;
    }
322614
def get_user_from_session(session_key):
    
    session = Session.objects.get(session_key=session_key)
    session_data = session.get_decoded()
    uid = session_data.get('_auth_user_id')
    user = get_user_model().objects.filter(id=uid).first()  # get object or none
    return user
1224298
def _lookup_required_session(self, key):
        
        session = self.session_handler.do_get_session(key)
        if (not session):
            msg = ("Unable to locate required Session instance based "
                   "on session_key [" + str(key) + "].")
            raise ValueError(msg)
        return session
609712
def get_session_key(limedict):
    """"""
    url = limedict['url']
    user = limedict['username']
    password = limedict['password']
    params = {'username': user, 'password': password}
    data = set_params('get_session_key', params)
    req = requests.post(url, data=data, headers=headers)
    return {'token': req.json()['result'], 'user': user, 'url': url}
8727
function getAction(key) {
    const keyString = key.toString();

    if (keyString.match(/CERTIFICATE\sREQUEST-{5}$/m)) {
        return 'req';
    }
    else if (keyString.match(/(PUBLIC|PRIVATE)\sKEY-{5}$/m)) {
        return 'rsa';
    }

    return 'x509';
}
601136
def get(self, key):
    '''
    '''
    self.logger.info('%s: get %s' % (self, key))
    value = super(LoggingDatastore, self).get(key)
    self.logger.debug('%s: %s' % (self, value))
    return value
1235680
def prepare_key(action, options = {})
      (
        options[:key] ||
        self.activity_key ||
        ((self.class.name.underscore.gsub('/', '_') + "." + action.to_s) if action)
      ).try(:to_s)
    end
1196832
def session_context(fn):
    
    @functools.wraps(fn)
    def wrap(*args, **kwargs):
        session = args[0].Session()  # obtain from self
        result = fn(*args, session=session, **kwargs)
        session.close()
        return result
    return wrap
1075107
def attach_session(self):
        
        assert self.session is None
        root = self.find_root()
        session = self.Session(root)
        root.inject_context(session=session)
        return session
1371552
def get_data(self, request, key='params'):
        
        return request.session.get('%s:%s' % (constants.SESSION_KEY, key))
732232
def _key(self, username, frozen=False):
        """"""
        if frozen:
            return self.frozen + username
        return self.prefix + username
226607
def get(self, *args, **kwargs):
        
        return self.session.get(*args, **self.get_kwargs(**kwargs))
1040537
def get_key(cls, k, default=None):
        
        k = cls.__name__ + "__" + k
        if k in session:
            return session[k]
        else:
            return default
1264149
def _get_session():
    """"""
    session = getattr(g, '_session', None)
    if session is None:
        session = g._session = db.session()
    return session