def _to_version_number(version: str) -> int:
    """Convert version string (e.g. '2020a') to an integer of the form YYNN
    (e.g. '2001'), where YY is (year - 2000) and NN is the patch number,
    where 'a' is 01.
    """
    year = version[0:4]
    patch = version[4]
    return (int(year) - 2000) * 100 + (ord(patch) - ord('a') + 1)