def leave(self, reason=None, log_message=None):
        if not self._session_id:
            raise SessionNotReady(u"session hasn't joined a realm")

        if not self._goodbye_sent:
            if not reason:
                reason = u"wamp.close.normal"
            msg = wamp.message.Goodbye(reason=reason, message=log_message)
            self._transport.send(msg)
            self._goodbye_sent = True
            # deferred that fires when transport actually hits CLOSED
            is_closed = self._transport is None or self._transport.is_closed
            return is_closed
        else:
            raise SessionNotReady(u"session was alread requested to leave")
Abstract validation method. Should validate the supplied metaparameters,
dataset/ETHPy150Open crossbario/autobahn-python/autobahn/wamp/protocol.py/ApplicationSession.leave--crossover with--dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/gridsearch.py/GridSearch2D._validate