Get session information.
494127
def info(self):
        
        if self._session_url is None:
            return None

        resp = self.get(self._session_url)
        resp.raise_for_status()
        return response_to_json_dict(resp)
1300812
def session(self):
        """"""
        from sqlalchemy.orm import sessionmaker
        from sqlalchemy.event import listen

        if not self.Session:
            self.Session = sessionmaker(bind=self.engine)

        if not self._session:
            self._session = self.Session()
            # set the search path

            if self._schema:
                def after_begin(session, transaction, connection):
                    # import traceback
                    # print traceback.print_stack()
                    session.execute('SET search_path TO {}'.format(self._schema))

                listen(self._session, 'after_begin', after_begin)

        return self._session
344850
def _get_provider_sessions(self):
        """"""
        agent_key = self._get_agent_key()
        sessions = []
        for session_name in self._provider_sessions[agent_key]:
            sessions.append(self._provider_sessions[agent_key][session_name])
        return sessions
814990
def session(connection_string=None):
    """"""
    global _session_makers
    connection_string = connection_string or oz.settings["db"]

    if not connection_string in _session_makers:
        _session_makers[connection_string] = sessionmaker(bind=engine(connection_string=connection_string))

    return _session_makers[connection_string]()
822710
def session(self):
        
        if self._session is None:
            self._session = requests.Session()
            self._session.headers.update(self._headers)
        return self._session
1353553
async def show_sessions(self):
        
        res = await self.call("wamp.session.list")
        for session_id in res:
            session = await self.call("wamp.session.get", session_id)
            self.log.info(session)
671874
def get_my_data(self, session=None):
        
        params = clean_locals(locals())
        method = 'GetMyData'
        (response, elapsed_time) = self.request(method, params, session)
        return response
1100777
def get_chat_info(self):
        """"""
        chat_info = self.json_response.get("chat_info", None)
        self.chat_info = chat_info
        self.logger.info("%s\t%s" % (self.request_method, self.request_url))
        return chat_info
1117503
def getReadSession(self):
        '''  '''
        if self.ReadSession is None:
            self.ReadSession=scoped_session(sessionmaker(bind=self.engine))

        return self.ReadSession
145980
async def get_data(self):
        """"""
        try:
            await self.get_session_data()
            await self.get_home_data()
            await self.get_users()
            await self.get_user_data()
        except (asyncio.TimeoutError, aiohttp.ClientError, socket.gaierror):
            msg = "Can not load data from Tautulli."
            logger(msg, 40)
822612
def get_session(account_info):
    
    s = getattr(CONN_CACHE, '%s-session' % account_info['name'], None)
    if s is not None:
        return s
    if account_info.get('role'):
        s = assumed_session(account_info['role'], SESSION_NAME)
    else:
        s = boto3.Session()
    setattr(CONN_CACHE, '%s-session' % account_info['name'], s)
    return s
771396
def get_summary(session):
    """"""
    profile = get_profile(session)
    return {
        'user': {
            'email': profile['userProfile']['eMail'],
            'name': '{} {}'.format(profile['userProfile']['firstName'],
                                   profile['userProfile']['lastName'])
        },
        'vehicles': [
            {
                'vin': vehicle['vin'],
                'year': vehicle['year'],
                'make': vehicle['make'],
                'model': _get_model(vehicle),
                'odometer': vehicle['odometerMileage']
            } for vehicle in profile['vehicles']
        ]
    }
368618
public function userInfo()
    {
        try {
            $this->startBrokerSession();

            $username = $this->getSessionData('sso_user');

            if (!$username) {
                $this->fail('User not authenticated. Session ID: ' . $this->getSessionData('id'));
            }

            if (!$user = $this->getUserInfo($username)) {
                $this->fail('User not found.');
            }
        } catch (SSOServerException $e) {
            return $this->returnJson(['error' => $e->getMessage()]);
        }

        return $this->returnUserInfo($user);
    }
1288907
def sessions_info(self, hosts):
        
        info_by_id = {}

        for server_endpoint, dump in self.dump_by_server(hosts).items():
            server_ip, server_port = server_endpoint
            for line in dump.split("\n"):
                mat = self.IP_PORT_REGEX.match(line)
                if mat is None:
                    continue
                ip, port, sid = mat.groups()
                info_by_id[sid] = ClientInfo(sid, ip, port, server_ip, server_port)

        return info_by_id
739289
def _get_at_from_session(self):
        
        try:
            return self.request.session['oauth_%s_access_token'
                                        % get_token_prefix(
                                            self.request_token_url)]
        except KeyError:
            raise OAuthError(
                _('No access token saved for "%s".')
                % get_token_prefix(self.request_token_url))
838417
def connections(self):
        """"""
        self._check_session()
        status, data = self._rest.get_request('connections')
        return data
837719
def __get_connection_info():
    '''
    
    '''
    conn_info = {}

    try:
        conn_info['hostname'] = __opts__['mysql_auth']['hostname']
        conn_info['username'] = __opts__['mysql_auth']['username']
        conn_info['password'] = __opts__['mysql_auth']['password']
        conn_info['database'] = __opts__['mysql_auth']['database']

        conn_info['auth_sql'] = __opts__['mysql_auth']['auth_sql']
    except KeyError as e:
        log.error('%s does not exist', e)
        return None

    return conn_info