def caseins_getattr(enum, attr):
    """Case-insensitive `getattr` for enumerated types."""
    lower_attr_keys = list(map(lambda x: x.lower(), enum._fields))
    attr_idx = lower_attr_keys.index(attr.lower())
    orig_attr = enum._fields[attr_idx]
    return getattr(enum, orig_attr)