# 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
# class DecorationLine(Enum):
# class ThousandSeparator(Enum):
# class VerticalAlign(Enum):
# class Style:
#     NONE = "none"
#     LINE_THROUGH = "line_through"
#     STRIKE = "strike"
#     UNDERLINE = "underline"
#     NONE = "none"  #: no thousands separator
#     COMMA = "comma"  #: ``','`` as thousands separator
#     SPACE = "space"  #: ``' '`` as thousands separator
#     UNDERSCORE = "underscore"  #: ``'_'`` as thousands separator
#     BASELINE = (1 << 0, "baseline")
#     TOP = (1 << 1, "top")
#     MIDDLE = (1 << 2, "middle")
#     BOTTOM = (1 << 3, "bottom")
#     def align_code(self):
#     def align_str(self):
#     def __init__(self, code, string):
# def _normalize_thousand_separator(value: Union[str, ThousandSeparator]) -> ThousandSeparator:
#     def align(self) -> Align:
#     def align(self, value: Align) -> None:
#     def vertical_align(self) -> VerticalAlign:
#     def decoration_line(self) -> DecorationLine:
#     def font_size(self) -> FontSize:
#     def font_style(self) -> FontStyle:
#     def font_weight(self) -> FontWeight:
#     def color(self) -> Optional[Color]:
#     def fg_color(self) -> Optional[Color]:
#     def bg_color(self) -> Optional[Color]:
#     def thousand_separator(self) -> ThousandSeparator:
#     def padding(self):
#     def padding(self, value: Optional[int]):
#     def __init__(self, **kwargs) -> None:
#     def __repr__(self) -> str:
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def update(self, **kwargs) -> None:
#     def __update_color(self, initialize: bool, **kwargs) -> None:
#     def __update_font(self, initialize: bool, **kwargs) -> None:
#     def __update_align(self, initialize: bool, **kwargs) -> None:
#     def __update_misc(self, initialize: bool, **kwargs) -> None:
#     def __validate_attr(self, attr_name: str, expected_type) -> None:


import abc
from typing import Any, Optional, cast
from tcolorpy import tcolor
from ._font import FontSize, FontStyle, FontWeight
from ._style import Align, DecorationLine, Style, ThousandSeparator
        from ..writer import RstCsvTableWriter
        from ..writer import RstCsvTableWriter

        if style.decoration_line in (DecorationLine.STRIKE, DecorationLine.LINE_THROUGH):
            ansi_styles.append("strike")
        if style.decoration_line == DecorationLine.UNDERLINE:
            ansi_styles.append("underline")

        if style.font_weight == FontWeight.BOLD:
            ansi_styles.append("bold")

        if self._writer.colorize_terminal:
            return tcolor(value, color=style.color, bg_color=style.bg_color, styles=ansi_styles)

        return tcolor(value, styles=ansi_styles)

    def __get_align_format(self, style: Style) -> str:
        align_char = get_align_char(style.align)
        format_items = ["{:" + align_char]
        if style.padding is not None and style.padding > 0:
            format_items.append(str(style.padding))
        format_items.append("s}")

        return "".join(format_items)

    def apply_align(self, value: str, style: Style) -> str:
        return self.__get_align_format(style).format(value)

    def apply(self, value: Any, style: Style) -> str:
        if value:
            if style.thousand_separator == ThousandSeparator.SPACE:
                value = value.replace(",", " ")

# 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
# class DecorationLine(Enum):
# class ThousandSeparator(Enum):
# class VerticalAlign(Enum):
# class Style:
#     NONE = "none"
#     LINE_THROUGH = "line_through"
#     STRIKE = "strike"
#     UNDERLINE = "underline"
#     NONE = "none"  #: no thousands separator
#     COMMA = "comma"  #: ``','`` as thousands separator
#     SPACE = "space"  #: ``' '`` as thousands separator
#     UNDERSCORE = "underscore"  #: ``'_'`` as thousands separator
#     BASELINE = (1 << 0, "baseline")
#     TOP = (1 << 1, "top")
#     MIDDLE = (1 << 2, "middle")
#     BOTTOM = (1 << 3, "bottom")
#     def align_code(self):
#     def align_str(self):
#     def __init__(self, code, string):
# def _normalize_thousand_separator(value: Union[str, ThousandSeparator]) -> ThousandSeparator:
#     def align(self) -> Align:
#     def align(self, value: Align) -> None:
#     def vertical_align(self) -> VerticalAlign:
#     def decoration_line(self) -> DecorationLine:
#     def font_size(self) -> FontSize:
#     def font_style(self) -> FontStyle:
#     def font_weight(self) -> FontWeight:
#     def color(self) -> Optional[Color]:
#     def fg_color(self) -> Optional[Color]:
#     def bg_color(self) -> Optional[Color]:
#     def thousand_separator(self) -> ThousandSeparator:
#     def padding(self):
#     def padding(self, value: Optional[int]):
#     def __init__(self, **kwargs) -> None:
#     def __repr__(self) -> str:
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def update(self, **kwargs) -> None:
#     def __update_color(self, initialize: bool, **kwargs) -> None:
#     def __update_font(self, initialize: bool, **kwargs) -> None:
#     def __update_align(self, initialize: bool, **kwargs) -> None:
#     def __update_misc(self, initialize: bool, **kwargs) -> None:
#     def __validate_attr(self, attr_name: str, expected_type) -> None:


# Path: pytablewriter/style/_styler.py
import abc
from typing import Any, Optional, cast
from tcolorpy import tcolor
from ._font import FontSize, FontStyle, FontWeight
from ._style import Align, DecorationLine, Style, ThousandSeparator
        from ..writer import RstCsvTableWriter
        from ..writer import RstCsvTableWriter


        if style.decoration_line in (DecorationLine.STRIKE, DecorationLine.LINE_THROUGH):
            ansi_styles.append("strike")
        if style.decoration_line == DecorationLine.UNDERLINE:
            ansi_styles.append("underline")

        if style.font_weight == FontWeight.BOLD:
            ansi_styles.append("bold")

        if self._writer.colorize_terminal:
            return tcolor(value, color=style.color, bg_color=style.bg_color, styles=ansi_styles)

        return tcolor(value, styles=ansi_styles)

    def __get_align_format(self, style: Style) -> str:
        align_char = get_align_char(style.align)
        format_items = ["{:" + align_char]
        if style.padding is not None and style.padding > 0:
            format_items.append(str(style.padding))
        format_items.append("s}")

        return "".join(format_items)

    def apply_align(self, value: str, style: Style) -> str:
        return self.__get_align_format(style).format(value)

    def apply(self, value: Any, style: Style) -> str:
        if value:
            if style.thousand_separator == ThousandSeparator.SPACE:
                value = value.replace(",", " ")

            elif style.thousand_separator == ThousandSeparator.UNDERSCORE: