old_contents: from enum import IntEnum
  
  
  class WorkMode(IntEnum):
      STANDALONE = 0
      CLUSTER = 1
  
      def is_standalone(self):
          return self.value == self.STANDALONE
  
      def is_cluster(self):
          return self.value == self.CLUSTER
  
  
  class Backend(IntEnum):
      EGGROLL = 0
      SPARK = 1
      STANDALONE = 1
  
      def is_spark(self):
          return self.value == self.SPARK
  
      def is_eggroll(self):
          return self.value == self.EGGROLL
  
  
  class EngineType(object):
      COMPUTING = "computing"
      STORAGE = "storage"
      FEDERATION = "federation"
  
  
  class CoordinateProxyService(object):
      rollsite = "rollsite"
      nginx = 'nginx'
  
  
  class FederatedMode(object):
      SINGLE = "SINGLE"
      MULTIPLE = "MULTIPLE"
  
      def is_single(self, value):
          return value == self.SINGLE
  
      def is_multiple(self, value):
          return value == self.MULTIPLE
  
  
  class FederatedCommunicationType(object):
      PUSH = "PUSH"
      PULL = "PULL"
  
  
  class Party(object):
      """
      Uniquely identify
      """
  
      def __init__(self, role, party_id):
          self.role = str(role)
          self.party_id = str(party_id)
  
      def __hash__(self):
          return (self.role, self.party_id).__hash__()
  
      def __str__(self):
          return f"Party(role={self.role}, party_id={self.party_id})"
  
      def __repr__(self):
          return self.__str__()
  
      def __lt__(self, other):
          return (self.role, self.party_id) < (other.role, other.party_id)
  
      def __eq__(self, other):
          return self.party_id == other.party_id and self.role == other.role
      def cleanup(self, party):
          LOGGER.debug("[rabbitmq.cleanup]start to cleanup...")
          low, high = (self._party, party) if self._party < party else (party, self._party)
          vhost = f"{self._session_id}-{low.role}-{low.party_id}-{high.role}-{high.party_id}"
  
          queues = self._rabbit_manager.get_all_queue(vhost=vhost)
          for queue in queues:
              try:
                  self._rabbit_manager.delete_queue(vhost=vhost, queue_name=queue.get('name'))
              except:
                  pass
          self._rabbit_manager.delete_vhost(vhost=vhost)
          self._queue_map.clear()
          if self._mq.union_name:
              LOGGER.debug(f"[rabbitmq.cleanup]clean user {self._mq.union_name}.")
              self._rabbit_manager.delete_user(user=self._mq.union_name)
new_contents: from enum import IntEnum
  
  
  class WorkMode(IntEnum):
      STANDALONE = 0
      CLUSTER = 1
  
      def is_standalone(self):
          return self.value == self.STANDALONE
  
      def is_cluster(self):
          return self.value == self.CLUSTER
  
  
  class Backend(IntEnum):
      EGGROLL = 0
      SPARK = 1
      STANDALONE = 1
  
      def is_spark(self):
          return self.value == self.SPARK
  
      def is_eggroll(self):
          return self.value == self.EGGROLL
  
  
  class EngineType(object):
      COMPUTING = "computing"
      STORAGE = "storage"
      FEDERATION = "federation"
  
  
  class CoordinateProxyService(object):
      rollsite = "rollsite"
      nginx = 'nginx'
  
  
  class FederatedMode(object):
      SINGLE = "SINGLE"
      MULTIPLE = "MULTIPLE"
  
      def is_single(self, value):
          return value == self.SINGLE
  
      def is_multiple(self, value):
          return value == self.MULTIPLE
  
  
  class FederatedCommunicationType(object):
      PUSH = "PUSH"
      PULL = "PULL"
  
  
  class Party(object):
      """
      Uniquely identify
      """
  
      def __init__(self, role, party_id):
          self.role = str(role)
          self.party_id = str(party_id)
  
      def __hash__(self):
          return (self.role, self.party_id).__hash__()
  
      def __str__(self):
          return f"Party(role={self.role}, party_id={self.party_id})"
  
      def __repr__(self):
          return self.__str__()
  
      def __lt__(self, other):
          return (self.role, self.party_id) < (other.role, other.party_id)
  
      def __eq__(self, other):
          return self.party_id == other.party_id and self.role == other.role
subject: modify rabbit cleanup ...