def to_enum_value(ival, enum_class, fallback, starter=-1):
    """
    convert the integer argument to the corresponding
    enumerator value on the given enumeration, if feasible,
    or the fallback value otherwise.
    """
    rmap = dict(enumerate(enum_class, starter))
    return rmap.get(ival, fallback)
