# Path: boris/portion/const.py
# class Bound(enum.Enum):
# class _Singleton():
# class _PInf(_Singleton):
# class _NInf(_Singleton):
#     CLOSED = True
#     OPEN = False
#     def __bool__(self):
#     def __invert__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __new__(cls, *args, **kwargs):
#     def __neg__(self): return _NInf()
#     def __lt__(self, o): return False
#     def __le__(self, o): return isinstance(o, _PInf)
#     def __gt__(self, o): return not isinstance(o, _PInf)
#     def __ge__(self, o): return True
#     def __eq__(self, o): return isinstance(o, _PInf)
#     def __repr__(self): return '+inf'
#     def __hash__(self): return hash(float('+inf'))
#     def __neg__(self): return _PInf()
#     def __lt__(self, o): return not isinstance(o, _NInf)
#     def __le__(self, o): return True
#     def __gt__(self, o): return False
#     def __ge__(self, o): return isinstance(o, _NInf)
#     def __eq__(self, o): return isinstance(o, _NInf)
#     def __repr__(self): return '-inf'
#     def __hash__(self): return hash(float('-inf'))


from collections import namedtuple
from .const import Bound, inf
    @property
    def empty(self):
        """
        True if interval is empty, False otherwise.
        """
        return (
            self.lower > self.upper or
            (self.lower == self.upper and (self.left == Bound.OPEN or self.right == Bound.OPEN))
        )

    @property
    def atomic(self):
        """
        True if this interval is atomic, False otherwise.
        An interval is atomic if it is composed of a single (possibly empty) atomic interval.
        """
        return len(self._intervals) == 1

    @staticmethod
    def from_atomic(left, lower, upper, right):
        """
        Create an Interval instance containing a single atomic interval.

        :param left: either CLOSED or OPEN.
        :param lower: value of the lower bound.
        :param upper: value of the upper bound.
        :param right: either CLOSED or OPEN.
        """
        instance = Interval()
        left = left if lower not in [inf, -inf] else Bound.OPEN

# Path: boris/portion/const.py
# class Bound(enum.Enum):
# class _Singleton():
# class _PInf(_Singleton):
# class _NInf(_Singleton):
#     CLOSED = True
#     OPEN = False
#     def __bool__(self):
#     def __invert__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __new__(cls, *args, **kwargs):
#     def __neg__(self): return _NInf()
#     def __lt__(self, o): return False
#     def __le__(self, o): return isinstance(o, _PInf)
#     def __gt__(self, o): return not isinstance(o, _PInf)
#     def __ge__(self, o): return True
#     def __eq__(self, o): return isinstance(o, _PInf)
#     def __repr__(self): return '+inf'
#     def __hash__(self): return hash(float('+inf'))
#     def __neg__(self): return _PInf()
#     def __lt__(self, o): return not isinstance(o, _NInf)
#     def __le__(self, o): return True
#     def __gt__(self, o): return False
#     def __ge__(self, o): return isinstance(o, _NInf)
#     def __eq__(self, o): return isinstance(o, _NInf)
#     def __repr__(self): return '-inf'
#     def __hash__(self): return hash(float('-inf'))


# Path: boris/portion/interval.py
from collections import namedtuple
from .const import Bound, inf

    @property
    def empty(self):
        """
        True if interval is empty, False otherwise.
        """
        return (
            self.lower > self.upper or
            (self.lower == self.upper and (self.left == Bound.OPEN or self.right == Bound.OPEN))
        )

    @property
    def atomic(self):
        """
        True if this interval is atomic, False otherwise.
        An interval is atomic if it is composed of a single (possibly empty) atomic interval.
        """
        return len(self._intervals) == 1

    @staticmethod
    def from_atomic(left, lower, upper, right):
        """
        Create an Interval instance containing a single atomic interval.

        :param left: either CLOSED or OPEN.
        :param lower: value of the lower bound.
        :param upper: value of the upper bound.
        :param right: either CLOSED or OPEN.
        """
        instance = Interval()
        left = left if lower not in [inf, -inf] else Bound.OPEN

        right = right if upper not in [inf, -inf] else Bound.OPEN