code: def clean_sessions(self, logout_request):
          
          try:
              slos = self.client.get_saml_slos(logout_request) or []
          except NameError:  # pragma: no cover (should not happen)
              slos = []
          for slo in slos:
              for federate_slo in FederateSLO.objects.filter(ticket=slo.text):
                  logger.info(
                      "Got an SLO requests for ticket %s, logging out user %s" % (
                          federate_slo.username,
                          federate_slo.ticket
                      )
                  )
                  session = SessionStore(session_key=federate_slo.session_key)
                  session.flush()
                  try:
                      user = User.objects.get(
                          username=federate_slo.username,
                          session_key=federate_slo.session_key
                      )
                      user.logout()
                      user.delete()
                  except User.DoesNotExist:  # pragma: no cover (should not happen)
                      pass
                  federate_slo.delete()
docs: process a SLO request: Search for ticket values in ``logout_request``. For each
              ticket value matching a :class:`cas_server.models.FederateSLO`, disconnect the
              corresponding user.
  
              :param unicode logout_request: An XML document contening one or more Single Log Out
                  requests.