# Path: hgvs/exceptions.py
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# Path: hgvs/enums.py



import logging
import hgvs
import hgvs.parser
import hgvs.edit
import hgvs.variantmapper
from hgvs.exceptions import HGVSInvalidVariantError, HGVSUnsupportedOperationError
from hgvs.enums import ValidationLevel, Datum
            raise HGVSInvalidVariantError(msg)
        return True


class ExtrinsicValidator():
    """
    Attempts to determine if the HGVS name validates against external data sources
    """

    def __init__(self, hdp, strict=hgvs.global_config.validator.strict):
        self.strict = strict
        self.hdp = hdp
        self.vm = hgvs.variantmapper.VariantMapper(self.hdp, prevalidation_level=None)

    def validate(self, var, strict=None):
        assert isinstance(var, hgvs.sequencevariant.SequenceVariant
                          ), "variant must be a parsed HGVS sequence variant object"
        if strict is None: strict = self.strict
        fail_level = ValidationLevel.WARNING if strict else ValidationLevel.ERROR

        var_n = None
        if var.type == "n":
            var_n = var
        elif var.type == "c":
            var_n = self.vm.c_to_n(var)

        if var_n is not None:
            res, msg = self._n_within_transcript_bounds(var_n)
            if res != ValidationLevel.VALID:
                if hgvs.global_config.mapping.strict_bounds:

# Path: hgvs/exceptions.py
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# Path: hgvs/enums.py



# Path: hgvs/validator.py
import logging
import hgvs
import hgvs.parser
import hgvs.edit
import hgvs.variantmapper
from hgvs.exceptions import HGVSInvalidVariantError, HGVSUnsupportedOperationError
from hgvs.enums import ValidationLevel, Datum

            raise HGVSInvalidVariantError(msg)
        return True


class ExtrinsicValidator():
    """
    Attempts to determine if the HGVS name validates against external data sources
    """

    def __init__(self, hdp, strict=hgvs.global_config.validator.strict):
        self.strict = strict
        self.hdp = hdp
        self.vm = hgvs.variantmapper.VariantMapper(self.hdp, prevalidation_level=None)

    def validate(self, var, strict=None):
        assert isinstance(var, hgvs.sequencevariant.SequenceVariant
                          ), "variant must be a parsed HGVS sequence variant object"
        if strict is None: strict = self.strict
        fail_level = ValidationLevel.WARNING if strict else ValidationLevel.ERROR

        var_n = None
        if var.type == "n":
            var_n = var
        elif var.type == "c":
            var_n = self.vm.c_to_n(var)

        if var_n is not None:
            res, msg = self._n_within_transcript_bounds(var_n)
            if res != ValidationLevel.VALID:
                if hgvs.global_config.mapping.strict_bounds:

                    raise HGVSInvalidVariantError(msg)