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



import attr
import hgvs
from functools import total_ordering
from bioutils.sequences import aa1_to_aa3
from hgvs.exceptions import HGVSUnsupportedOperationError, HGVSInvalidIntervalError
from hgvs.enums import Datum, ValidationLevel

    def _length(self):
        return 1 if self.end is None else self.end - self.start + 1

    @property
    def is_uncertain(self):
        """return True if the position is marked uncertain or undefined"""
        return self.uncertain or self.start.is_uncertain or self.end.is_uncertain


@attr.s(slots=True, repr=False)
class BaseOffsetInterval(Interval):
    """BaseOffsetInterval isa Interval of BaseOffsetPositions.  The only
    additional functionality over Interval is to ensure that the dutum
    of end and start are compatible.

    """

    def __attrs_post_init__(self):
        # #330: In a post-ter interval like *87_91, the * binds only
        # to the start. This means that the start.datum is CDS_END,
        # but the end.datum is CDS_START (the default).
        if self.start.datum == Datum.CDS_END:
            self.end.datum = Datum.CDS_END
        self.check_datum()

    def check_datum(self):
        # check for valid combinations of start and end datums
        if (self.start.datum, self.end.datum) not in [
            (Datum.SEQ_START, Datum.SEQ_START),

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



# Path: hgvs/location.py
import attr
import hgvs
from functools import total_ordering
from bioutils.sequences import aa1_to_aa3
from hgvs.exceptions import HGVSUnsupportedOperationError, HGVSInvalidIntervalError
from hgvs.enums import Datum, ValidationLevel


    def _length(self):
        return 1 if self.end is None else self.end - self.start + 1

    @property
    def is_uncertain(self):
        """return True if the position is marked uncertain or undefined"""
        return self.uncertain or self.start.is_uncertain or self.end.is_uncertain


@attr.s(slots=True, repr=False)
class BaseOffsetInterval(Interval):
    """BaseOffsetInterval isa Interval of BaseOffsetPositions.  The only
    additional functionality over Interval is to ensure that the dutum
    of end and start are compatible.

    """

    def __attrs_post_init__(self):
        # #330: In a post-ter interval like *87_91, the * binds only
        # to the start. This means that the start.datum is CDS_END,
        # but the end.datum is CDS_START (the default).
        if self.start.datum == Datum.CDS_END:
            self.end.datum = Datum.CDS_END
        self.check_datum()

    def check_datum(self):
        # check for valid combinations of start and end datums
        if (self.start.datum, self.end.datum) not in [
            (Datum.SEQ_START, Datum.SEQ_START),

            (Datum.CDS_START, Datum.CDS_START),