# Path: sqlalchemy/util/compat.py
#     def u(s):
#     def ue(s):
#     def b(s):
#         def callable(fn):
#     def cmp(a, b):
#     def b64encode(x):
#     def b64decode(x):
#     def iterbytes(buf):
#     def u(s):
#     def ue(s):
#     def b(s):
#     def import_(*args):
#     def print_(*args, **kwargs):
#         def __init__(self, values=None):
#         def __iter__(self):
#         def union(self, other):
#         def add(self, other):
#     def reraise(tp, value, tb=None, cause=None):
#     def raise_from_cause(exception, exc_info=None):
#     def raise_from_cause(exception, exc_info=None):
#     def exec_(func_text, globals_, lcl=None):
# def with_metaclass(meta, *bases):
#         def __new__(cls, name, this_bases, d):
#     class WeakSet(object):
#     class metaclass(meta):
# 
# Path: sqlalchemy/util/compat.py
#     def u(s):
#     def ue(s):
#     def b(s):
#         def callable(fn):
#     def cmp(a, b):
#     def b64encode(x):
#     def b64decode(x):
#     def iterbytes(buf):
#     def u(s):
#     def ue(s):
#     def b(s):
#     def import_(*args):
#     def print_(*args, **kwargs):
#         def __init__(self, values=None):
#         def __iter__(self):
#         def union(self, other):
#         def add(self, other):
#     def reraise(tp, value, tb=None, cause=None):
#     def raise_from_cause(exception, exc_info=None):
#     def raise_from_cause(exception, exc_info=None):
#     def exec_(func_text, globals_, lcl=None):
# def with_metaclass(meta, *bases):
#         def __new__(cls, name, this_bases, d):
#     class WeakSet(object):
#     class metaclass(meta):


import itertools
import weakref
import operator
from .compat import threading, itertools_filterfalse
from . import py2k
            return self._members != other._members
        else:
            return True

    def issubset(self, iterable):
        other = type(self)(iterable)

        if len(self) > len(other):
            return False
        for m in itertools_filterfalse(other._members.__contains__,
                                        iter(self._members.keys())):
            return False
        return True

    def __le__(self, other):
        if not isinstance(other, IdentitySet):
            return NotImplemented
        return self.issubset(other)

    def __lt__(self, other):
        if not isinstance(other, IdentitySet):
            return NotImplemented
        return len(self) < len(other) and self.issubset(other)

    def issuperset(self, iterable):
        other = type(self)(iterable)

        if len(self) < len(other):
            return False


# Path: sqlalchemy/util/compat.py
#     def u(s):
#     def ue(s):
#     def b(s):
#         def callable(fn):
#     def cmp(a, b):
#     def b64encode(x):
#     def b64decode(x):
#     def iterbytes(buf):
#     def u(s):
#     def ue(s):
#     def b(s):
#     def import_(*args):
#     def print_(*args, **kwargs):
#         def __init__(self, values=None):
#         def __iter__(self):
#         def union(self, other):
#         def add(self, other):
#     def reraise(tp, value, tb=None, cause=None):
#     def raise_from_cause(exception, exc_info=None):
#     def raise_from_cause(exception, exc_info=None):
#     def exec_(func_text, globals_, lcl=None):
# def with_metaclass(meta, *bases):
#         def __new__(cls, name, this_bases, d):
#     class WeakSet(object):
#     class metaclass(meta):
# 
# Path: sqlalchemy/util/compat.py
#     def u(s):
#     def ue(s):
#     def b(s):
#         def callable(fn):
#     def cmp(a, b):
#     def b64encode(x):
#     def b64decode(x):
#     def iterbytes(buf):
#     def u(s):
#     def ue(s):
#     def b(s):
#     def import_(*args):
#     def print_(*args, **kwargs):
#         def __init__(self, values=None):
#         def __iter__(self):
#         def union(self, other):
#         def add(self, other):
#     def reraise(tp, value, tb=None, cause=None):
#     def raise_from_cause(exception, exc_info=None):
#     def raise_from_cause(exception, exc_info=None):
#     def exec_(func_text, globals_, lcl=None):
# def with_metaclass(meta, *bases):
#         def __new__(cls, name, this_bases, d):
#     class WeakSet(object):
#     class metaclass(meta):


# Path: sqlalchemy/util/_collections.py
import itertools
import weakref
import operator
from .compat import threading, itertools_filterfalse
from . import py2k

            return self._members != other._members
        else:
            return True

    def issubset(self, iterable):
        other = type(self)(iterable)

        if len(self) > len(other):
            return False
        for m in itertools_filterfalse(other._members.__contains__,
                                        iter(self._members.keys())):
            return False
        return True

    def __le__(self, other):
        if not isinstance(other, IdentitySet):
            return NotImplemented
        return self.issubset(other)

    def __lt__(self, other):
        if not isinstance(other, IdentitySet):
            return NotImplemented
        return len(self) < len(other) and self.issubset(other)

    def issuperset(self, iterable):
        other = type(self)(iterable)

        if len(self) < len(other):
            return False


        for m in itertools_filterfalse(self._members.__contains__,