mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
13 lines
269 B
Python
13 lines
269 B
Python
|
from enum import EnumMeta
|
||
|
|
||
|
|
||
|
class MetaEnum(EnumMeta):
|
||
|
"""Metaclass to support `in` syntax value checking in String Enums"""
|
||
|
|
||
|
def __contains__(cls, item):
|
||
|
try:
|
||
|
cls(item)
|
||
|
except ValueError:
|
||
|
return False
|
||
|
return True
|