def get_session(self, session_id: int) -> core_pb2.GetSessionResponse: """ Retrieve a session. :param session_id: id of session :return: response with sessions state, nodes, and links :raises grpc.RpcError: when session doesn't exist """ request = core_pb2.GetSessionRequest(session_id=session_id) return self.stub.GetSession(request)
def get_session(self, session_id: int) -> wrappers.Session: """ Retrieve a session. :param session_id: id of session :return: session :raises grpc.RpcError: when session doesn't exist """ request = core_pb2.GetSessionRequest(session_id=session_id) response = self.stub.GetSession(request) return wrappers.Session.from_proto(response.session)