def METHOD_NAME(self, version: str) -> tuple[str, int]:
    # Epoch and revision
    version = version.split(':', 1)[-1]
    version = version.rsplit('-', 1)[0]
    flags = 0
    # Process parts
    parts = _DEBIAN_SPLIT_RE.split(version)
    version = parts[0]
    alpha_parts_count = 0
    for part in parts[1:]:
        if self._garbage_part_re.fullmatch(part) is not None:
            # Garbage parts which have nothing to do with upstream
            # version, such as `+dfsg1`. Drop these.
            continue
        # Count parts which contain letters
        this_alpha_part_pos = None
        if _DEBIAN_ALPHA_RE.search(part) is not None:
            this_alpha_part_pos = alpha_parts_count
            alpha_parts_count += 1
        # Allowed meaningful prerelease parts, such as `~beta2`
        if _DEBIAN_GOOD_PRERELEASE_LONG_PART_RE.fullmatch(part) is not None:
            flags |= PackageFlags.DEVEL
            version += part
            continue
        # Allowed meaningful prerelease short parts, such as `~b2`
        if _DEBIAN_GOOD_PRERELEASE_SHORT_PART_RE.fullmatch(part) is not None:
            flags |= PackageFlags.DEVEL
            version += part
            continue
        # Allowed meaningful postrelease parts, such as `-patch1`
        if _DEBIAN_GOOD_POSTRELEASE_PART_RE.fullmatch(part) is not None:
            version += part
            continue
        # Pre-snapshots. Marked incorrect as the "future" version they
        # are based on is made up, with the exception of when it's equal
        # to 0 which indicates that upstream has no official releases
        if part.startswith('~'):
            flags |= PackageFlags.IGNORE if version_compare(parts[0], '0') == 0 else PackageFlags.INCORRECT
            version += part
            continue
        #
        # The remaining cases are (assumed) post-snapshots
        #
        # Special handling for post- suffixes which start with letter,
        # such as `1.1+git20210203`. These are marked ANY_IS_PATCH to
        # compare greater than e.g. `1.1`, respecting intended `+`
        # behavior. Unfortunately, we can only handle first such suffix
        if this_alpha_part_pos == 0 and _DEBIAN_POST_ALPHA_RE.match(part) is not None:
            flags |= PackageFlags.ANY_IS_PATCH
        flags |= PackageFlags.IGNORE
        version += part
    if self._embedded_garbage_re.search(version) is not None:
        # Remaining garbage bits which cannot be separated from upstream
        # version. Always incorrect.
        flags |= PackageFlags.INCORRECT
    return version, flags