# Path: pytablewriter/_function.py
# def normalize_enum(
#     value, enum_class: Type[Enum], validate: bool = True, default: Optional[Enum] = None
# ):
#     if value is None:
#         return default
# 
#     if isinstance(value, enum_class):
#         return value
# 
#     try:
#         return enum_class[replace_symbol(value.strip(), "_").upper()]
#     except AttributeError:
#         if validate:
#             raise TypeError(f"value must be a {enum_class} or a str: actual={type(value)}")
#     except KeyError:
#         if validate:
#             raise ValueError(
#                 "invalid valid found: expected={}, actual={}".format(
#                     "/".join(item.name for item in enum_class), value
#                 )
#             )
# 
#     return value
# 
# Path: pytablewriter/style/_font.py
# class FontSize(Enum):
#     NONE = "none"
#     TINY = "tiny"
#     SMALL = "small"
#     MEDIUM = "medium"
#     LARGE = "large"
# 
# class FontStyle(Enum):
#     NORMAL = "normal"
#     ITALIC = "italic"
# 
# class FontWeight(Enum):
#     NORMAL = "normal"
#     BOLD = "bold"


from enum import Enum, unique
from typing import Optional, Union, cast
from dataproperty import Align
from tcolorpy import Color
from .._function import normalize_enum
from ._font import FontSize, FontStyle, FontWeight
        align = kwargs.get("align")
        if align:
            self.__align = normalize_enum(align, Align, default=Align.AUTO)
        elif initialize:
            self.__align = Align.AUTO

        valign = kwargs.get("vertical_align")
        if valign:
            self.__valign = normalize_enum(valign, VerticalAlign, default=VerticalAlign.BASELINE)
        elif initialize:
            self.__valign = VerticalAlign.BASELINE

    def __update_misc(self, initialize: bool, **kwargs) -> None:
        padding = kwargs.get("padding")
        if padding is not None:
            self.__padding = padding
        elif initialize:
            self.__padding = None

        decoration_line = kwargs.get("decoration_line")
        if decoration_line:
            self.__decoration_line = normalize_enum(
                decoration_line, DecorationLine, default=DecorationLine.NONE
            )
        elif initialize:
            self.__decoration_line = DecorationLine.NONE

        thousand_separator = kwargs.get("thousand_separator")
        if thousand_separator:
            self.__thousand_separator = _normalize_thousand_separator(

# Path: pytablewriter/_function.py
# def normalize_enum(
#     value, enum_class: Type[Enum], validate: bool = True, default: Optional[Enum] = None
# ):
#     if value is None:
#         return default
# 
#     if isinstance(value, enum_class):
#         return value
# 
#     try:
#         return enum_class[replace_symbol(value.strip(), "_").upper()]
#     except AttributeError:
#         if validate:
#             raise TypeError(f"value must be a {enum_class} or a str: actual={type(value)}")
#     except KeyError:
#         if validate:
#             raise ValueError(
#                 "invalid valid found: expected={}, actual={}".format(
#                     "/".join(item.name for item in enum_class), value
#                 )
#             )
# 
#     return value
# 
# Path: pytablewriter/style/_font.py
# class FontSize(Enum):
#     NONE = "none"
#     TINY = "tiny"
#     SMALL = "small"
#     MEDIUM = "medium"
#     LARGE = "large"
# 
# class FontStyle(Enum):
#     NORMAL = "normal"
#     ITALIC = "italic"
# 
# class FontWeight(Enum):
#     NORMAL = "normal"
#     BOLD = "bold"


# Path: pytablewriter/style/_style.py
from enum import Enum, unique
from typing import Optional, Union, cast
from dataproperty import Align
from tcolorpy import Color
from .._function import normalize_enum
from ._font import FontSize, FontStyle, FontWeight

        align = kwargs.get("align")
        if align:
            self.__align = normalize_enum(align, Align, default=Align.AUTO)
        elif initialize:
            self.__align = Align.AUTO

        valign = kwargs.get("vertical_align")
        if valign:
            self.__valign = normalize_enum(valign, VerticalAlign, default=VerticalAlign.BASELINE)
        elif initialize:
            self.__valign = VerticalAlign.BASELINE

    def __update_misc(self, initialize: bool, **kwargs) -> None:
        padding = kwargs.get("padding")
        if padding is not None:
            self.__padding = padding
        elif initialize:
            self.__padding = None

        decoration_line = kwargs.get("decoration_line")
        if decoration_line:
            self.__decoration_line = normalize_enum(
                decoration_line, DecorationLine, default=DecorationLine.NONE
            )
        elif initialize:
            self.__decoration_line = DecorationLine.NONE

        thousand_separator = kwargs.get("thousand_separator")
        if thousand_separator:
            self.__thousand_separator = _normalize_thousand_separator(

                normalize_enum(