def is_valid_version_code(version):
    """ Checks that the given version code is valid.
    """
    return version is not None and len(version) == 5 and \
        int(version[:4]) in range(1990, 2050) and \
        version[4] in ['h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']