code: def logout(self):
          
          if self._logged_in is True:
              self.si.flush_cache()
              self.sc.sessionManager.Logout()
              self._logged_in = False
docs: Logout of a vSphere server.