Get information about a session.

        :param session_id: The ID of the session.
19387
def get_session(self, session_id: int) -> Optional[Session]:
        
        try:
            data = self._client.get(f"/sessions/{session_id}")
        except requests.HTTPError as e:
            if e.response.status_code == 404:
                return None
            else:
                raise
        return Session.from_json(data)
790982
def info(self, server_id):
        
        result = self._storage[server_id].info()
        result['id'] = server_id
        return result
661546
def destroy_session(self, session_id):
        

        try:
            del self.sessions[session_id]
        except KeyError:
            pass

        # Invoke hooks
        invoke_hooks(self.hooks, "session_destroyed", session_id)
1214883
public String getId(IDbgpSession session)
	{
		final PerSessionInfo info;
		synchronized (sessions)
		{
			info = (PerSessionInfo) sessions.get(session);
		}
		return info != null ? info.identifier : null;
	}
1355871
def session_info(self, session):
        
        _, sp_hkey = self._keygen(session)
        picked_event = self.r.hgetall(sp_hkey)
        event = {s(k): pickle.loads(v) for k, v in picked_event.items()}
        return event
578968
private function _getSession($sessionId)
    {
        if (is_null($this->_session)) {
            $this->_session = $this->_repository->find(array('sessionId' => $sessionId));
        }

        return $this->_session;
    }
1249256
def FetchResponses(self, session_id):
    
    timestamp = (0, self.frozen_timestamp or rdfvalue.RDFDatetime.Now())

    for response in self.data_store.FetchResponsesForWellKnownFlow(
        session_id, self.response_limit, timestamp=timestamp):
      yield response
390915
public function read($session_id)
	{
		// get session hash
		$session = $this->database->hgetall($this->key($session_id));

		// return session data
		return (isset($session['data'])) ? $session['data'] : null;
	}
1204219
def get_stream_url(self, session_id, stream_id=None):
        
        url = self.api_url + '/v2/project/' + self.api_key + '/session/' + session_id + '/stream'
        if stream_id:
            url = url + '/' + stream_id
        return url
784716
public function read($session_id)
    {
        foreach ($this->getHandlers() as $handler) {
            if ($data = $handler->read($session_id)) {
                return $data;
            }
        }

        return '';
    }
377193
def read_info(self):
        '''
        
        '''
        self.select('*')
        row = self._cursor.fetchone()
        if not row:
            return None
        info_d = self.row_to_dict(row)
        return SessionInfo.from_dict(info_d)
116483
def get_session_id
      get = Net::HTTP::Get.new(@rpc_path)

      add_basic_auth(get)

      response = request(get)

      id = response.header['x-transmission-session-id']

      if id.nil?
        @log.debug("could not obtain session id (#{response.code}, " +
          "#{response.class})")
      else
        @log.debug('got session id ' + id)
      end

      id
    end
364813
def by_id(cls, _id, engine_or_session):
        
        ses, auto_close = ensure_session(engine_or_session)
        obj = ses.query(cls).get(_id)
        if auto_close:
            ses.close()
        return obj
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
1311811
def list_statements(self, session_id: int) -> List[Statement]:
        
        response = self._client.get(f"/sessions/{session_id}/statements")
        return [
            Statement.from_json(session_id, data)
            for data in response["statements"]
        ]
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
824682
private Result sessionInfoForSession(String sessionId) {

        Map<String, Object> dataEachSession = new HashMap<>();
        StatsStorage ss = knownSessionIDs.get(sessionId);
        if (ss != null) {
            Map<String, Object> dataThisSession = sessionData(sessionId, ss);
            dataEachSession.put(sessionId, dataThisSession);
        }
        return Results.ok(asJson(dataEachSession)).as("application/json");
    }