# Path: infi/pyutils/python_compat.py
# _PYTHON_VERSION = platform.python_version()
# _IS_PYTHON_3 = _PYTHON_VERSION >= '3'
# _IS_BELOW_PYTHON_2_7 = _PYTHON_VERSION < '2.7'
# def get_underlying_function(f):
# def _get_underlying_classmethod_function(f):
#     def create_bound_method(func, self):
#     class TemporaryClass(object):


from packaging.version import Version, parse
from .python_compat import OrderedDict, itervalues
    def __repr__(self):
        return self._key.upper()

    def __reduce__(self, *args, **kwargs):
        return (self.__class__, (self._key, dict((str(k), v) for k, v in self._values.items()), str(self._version)))

class Enum(VersionedBase):
    """
    An Enum class for python.
    
    >>> x = Enum(VersionedValue("True",{'1.0': ["TRUE"],
                                        '2.0': ["True","yes"]}),
                 VersionedValue("False",{'1.0': ["FALSE"],
                                         '2.0': ["False","No"]}))
    >>> x.true
    TRUE
    >>> "TRUE" in x
    True
    >>> x.false
    FALSE
    >>> x.false == "NOT"
    True
    >>> "NOT" in x
    True
    >>> "FALSE" in x
    True    
    """
    def __init__(self, *values, **kwargs):
        default_version = kwargs.get('default_version', ALL)
        super(Enum, self).__init__(default_version)

# Path: infi/pyutils/python_compat.py
# _PYTHON_VERSION = platform.python_version()
# _IS_PYTHON_3 = _PYTHON_VERSION >= '3'
# _IS_BELOW_PYTHON_2_7 = _PYTHON_VERSION < '2.7'
# def get_underlying_function(f):
# def _get_underlying_classmethod_function(f):
#     def create_bound_method(func, self):
#     class TemporaryClass(object):


# Path: infi/pyutils/enums.py
from packaging.version import Version, parse
from .python_compat import OrderedDict, itervalues

    def __repr__(self):
        return self._key.upper()

    def __reduce__(self, *args, **kwargs):
        return (self.__class__, (self._key, dict((str(k), v) for k, v in self._values.items()), str(self._version)))

class Enum(VersionedBase):
    """
    An Enum class for python.
    
    >>> x = Enum(VersionedValue("True",{'1.0': ["TRUE"],
                                        '2.0': ["True","yes"]}),
                 VersionedValue("False",{'1.0': ["FALSE"],
                                         '2.0': ["False","No"]}))
    >>> x.true
    TRUE
    >>> "TRUE" in x
    True
    >>> x.false
    FALSE
    >>> x.false == "NOT"
    True
    >>> "NOT" in x
    True
    >>> "FALSE" in x
    True    
    """
    def __init__(self, *values, **kwargs):
        default_version = kwargs.get('default_version', ALL)
        super(Enum, self).__init__(default_version)

        self._values = OrderedDict()