code: def session_end(self):
          
          self.session_depth -= 1
          self.session_depth = max(0, self.session_depth)
          if self.session_depth == 0:
              self._session_end()
docs: End a session.  Se session_begin for an in depth description of TREZOR sessions.