code: def on_session_end(self, session):
          
          if not isinstance(session, ISession):
              raise TypeError("session can only be an instance of type ISession")
          progress = self._call("onSessionEnd",
                       in_p=[session])
          progress = IProgress(progress)
          return progress
docs: Triggered by the given session object when the session is about
          to close normally.
  
          in session of type :class:`ISession`
              Session that is being closed
  
          return progress of type :class:`IProgress`
              Used to wait until the corresponding machine is actually
              dissociated from the given session on the server.
              Returned only when this session is a direct one.