# Path: uqbar/strings.py
# def to_snake_case(string: str) -> str:
#     """
#     Convert a string to underscore-delimited words.
# 
#     ::
# 
#         >>> import uqbar.strings
#         >>> string = 'Tô Đặc Biệt Xe Lửa'
#         >>> print(uqbar.strings.to_snake_case(string))
#         to_dac_biet_xe_lua
# 
#     ::
# 
#         >>> string = 'alpha.beta.gamma'
#         >>> print(uqbar.strings.to_snake_case(string))
#         alpha_beta_gamma
# 
#     """
#     string = unidecode.unidecode(string)
#     words = (_.lower() for _ in delimit_words(string))
#     string = "_".join(words)
#     return string


import enum
from uqbar.strings import to_snake_case



def from_expr(cls, expr):
    if isinstance(expr, cls):
        return expr
    elif isinstance(expr, float):
        return cls(int(expr))
    elif isinstance(expr, int):
        return cls(expr)
    elif isinstance(expr, str):

# Path: uqbar/strings.py
# def to_snake_case(string: str) -> str:
#     """
#     Convert a string to underscore-delimited words.
# 
#     ::
# 
#         >>> import uqbar.strings
#         >>> string = 'Tô Đặc Biệt Xe Lửa'
#         >>> print(uqbar.strings.to_snake_case(string))
#         to_dac_biet_xe_lua
# 
#     ::
# 
#         >>> string = 'alpha.beta.gamma'
#         >>> print(uqbar.strings.to_snake_case(string))
#         alpha_beta_gamma
# 
#     """
#     string = unidecode.unidecode(string)
#     words = (_.lower() for _ in delimit_words(string))
#     string = "_".join(words)
#     return string


# Path: uqbar/enums.py
import enum
from uqbar.strings import to_snake_case




def from_expr(cls, expr):
    if isinstance(expr, cls):
        return expr
    elif isinstance(expr, float):
        return cls(int(expr))
    elif isinstance(expr, int):
        return cls(expr)
    elif isinstance(expr, str):

        coerced_expr = to_snake_case(expr.strip()).upper()