import enum


def enum_value(value):
    """
    If value is an enum, extract and return it's value.

    Otherwise, return it as-is.

    :param value: value to extract enum from
    :return: value
    """
    if isinstance(value, enum.Enum):
        return value.value
    return value