# Path: hgvs/utils/norm.py
# def normalize_alleles(ref, start, stop, alleles, bound, ref_step, left, shuffle=True):
#     if left:
#         return normalize_alleles_left(ref, start, stop, alleles, bound, ref_step, shuffle)
#     else:
#         return normalize_alleles_right(ref, start, stop, alleles, bound, ref_step, shuffle)
# 
# Path: hgvs/exceptions.py
# class HGVSDataNotAvailableError(HGVSError):
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass


import copy
import logging
import hgvs
import hgvs.validator
import hgvs.variantmapper
from bioutils.sequences import reverse_complement
from hgvs.utils.norm import normalize_alleles
from hgvs.exceptions import HGVSDataNotAvailableError, HGVSUnsupportedOperationError, HGVSInvalidVariantError
        if validate:
            self.validator = hgvs.validator.IntrinsicValidator(strict=False)
        self.vm = variantmapper or hgvs.variantmapper.VariantMapper(self.hdp)

    def normalize(self, var):
        """Perform sequence variants normalization for single variant
        """
        assert isinstance(var, hgvs.sequencevariant.SequenceVariant
                          ), "variant must be a parsed HGVS sequence variant object"

        # keep a shallow reference to the original variant, to be returned
        # as-is under certain circumstances
        orig_var = var

        if self.validator:
            self.validator.validate(var)

        init_met = False
        if var.posedit is not None and isinstance(var.posedit, hgvs.edit.AARefAlt):
            init_met = var.posedit.init_met

        if var.posedit is None or var.posedit.uncertain or init_met or var.posedit.pos is None:
            return var

        type = var.type

        if type == "p":
            raise HGVSUnsupportedOperationError(
                "Unsupported normalization of protein level variants: {0}".format(var))
        if var.posedit.edit.type == "con":

# Path: hgvs/utils/norm.py
# def normalize_alleles(ref, start, stop, alleles, bound, ref_step, left, shuffle=True):
#     if left:
#         return normalize_alleles_left(ref, start, stop, alleles, bound, ref_step, shuffle)
#     else:
#         return normalize_alleles_right(ref, start, stop, alleles, bound, ref_step, shuffle)
# 
# Path: hgvs/exceptions.py
# class HGVSDataNotAvailableError(HGVSError):
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass


# Path: hgvs/normalizer.py
import copy
import logging
import hgvs
import hgvs.validator
import hgvs.variantmapper
from bioutils.sequences import reverse_complement
from hgvs.utils.norm import normalize_alleles
from hgvs.exceptions import HGVSDataNotAvailableError, HGVSUnsupportedOperationError, HGVSInvalidVariantError

        if validate:
            self.validator = hgvs.validator.IntrinsicValidator(strict=False)
        self.vm = variantmapper or hgvs.variantmapper.VariantMapper(self.hdp)

    def normalize(self, var):
        """Perform sequence variants normalization for single variant
        """
        assert isinstance(var, hgvs.sequencevariant.SequenceVariant
                          ), "variant must be a parsed HGVS sequence variant object"

        # keep a shallow reference to the original variant, to be returned
        # as-is under certain circumstances
        orig_var = var

        if self.validator:
            self.validator.validate(var)

        init_met = False
        if var.posedit is not None and isinstance(var.posedit, hgvs.edit.AARefAlt):
            init_met = var.posedit.init_met

        if var.posedit is None or var.posedit.uncertain or init_met or var.posedit.pos is None:
            return var

        type = var.type

        if type == "p":
            raise HGVSUnsupportedOperationError(
                "Unsupported normalization of protein level variants: {0}".format(var))
        if var.posedit.edit.type == "con":

            raise HGVSUnsupportedOperationError(