def METHOD_NAME(cls, key: Any):
    if key in cls:
        return EnumWrapper(key, cls[key])
    elif key in cast(Any, cls)._value2member_map_:
        return EnumWrapper(key, cls(key))
    elif key in [str(v.value) for v in cast(Any, cls).__members__.values()]:
        return EnumWrapper(
            key,
            next(v for v in cast(Any, cls).__members__.values() if v.value == key),
        )
    return EnumWrapper(key)