# Path: hgvs/exceptions.py
# class HGVSInvalidIntervalError(HGVSError):
#     pass


import logging
import re
from hgvs.exceptions import HGVSInvalidIntervalError
from six.moves import range
class Interval(object):
    """Represents a segment of a sequence in interbase
    coordinates (0-based, right-open).
    """
    __slots__ = ("start_i", "end_i")

    def __init__(self, start_i, end_i):
        if not (start_i <= end_i):
            raise HGVSInvalidIntervalError("start_i must be less than or equal to end_i")
        self.start_i = start_i
        self.end_i = end_i

    @property
    def len(self):
        return self.end_i - self.start_i

    def __repr__(self):
        return "{self.__class__.__name__}(start_i={self.start_i},end_i={self.end_i})".format(
            self=self)


class IntervalPair(object):
    """Represents a match, insertion, or deletion segment of an
    alignment. If a match, the lengths must be equal; if an insertion or
    deletion, the length of the ref or tgt must be zero respectively."""
    __slots__ = ("ref", "tgt")

    def __init__(self, ref, tgt):
        if not ((ref.len == tgt.len) or (ref.len == 0 and tgt.len != 0) or
                (ref.len != 0 and tgt.len == 0)):

# Path: hgvs/exceptions.py
# class HGVSInvalidIntervalError(HGVSError):
#     pass


# Path: hgvs/intervalmapper.py
import logging
import re
from hgvs.exceptions import HGVSInvalidIntervalError
from six.moves import range

class Interval(object):
    """Represents a segment of a sequence in interbase
    coordinates (0-based, right-open).
    """
    __slots__ = ("start_i", "end_i")

    def __init__(self, start_i, end_i):
        if not (start_i <= end_i):
            raise HGVSInvalidIntervalError("start_i must be less than or equal to end_i")
        self.start_i = start_i
        self.end_i = end_i

    @property
    def len(self):
        return self.end_i - self.start_i

    def __repr__(self):
        return "{self.__class__.__name__}(start_i={self.start_i},end_i={self.end_i})".format(
            self=self)


class IntervalPair(object):
    """Represents a match, insertion, or deletion segment of an
    alignment. If a match, the lengths must be equal; if an insertion or
    deletion, the length of the ref or tgt must be zero respectively."""
    __slots__ = ("ref", "tgt")

    def __init__(self, ref, tgt):
        if not ((ref.len == tgt.len) or (ref.len == 0 and tgt.len != 0) or
                (ref.len != 0 and tgt.len == 0)):

            raise HGVSInvalidIntervalError(