# Path: cmd2/ansi.py
# class Fg(FgColor, Enum):
#     """
#     Create ANSI sequences for the 16 standard terminal foreground text colors.
#     A terminal's color settings affect how these colors appear.
#     To reset any foreground color, use Fg.RESET.
#     """
# 
#     BLACK = 30
#     RED = 31
#     GREEN = 32
#     YELLOW = 33
#     BLUE = 34
#     MAGENTA = 35
#     CYAN = 36
#     LIGHT_GRAY = 37
#     DARK_GRAY = 90
#     LIGHT_RED = 91
#     LIGHT_GREEN = 92
#     LIGHT_YELLOW = 93
#     LIGHT_BLUE = 94
#     LIGHT_MAGENTA = 95
#     LIGHT_CYAN = 96
#     WHITE = 97
# 
#     RESET = 39
# 
#     def __str__(self) -> str:
#         """
#         Return ANSI color sequence instead of enum name
#         This is helpful when using an Fg in an f-string or format() call
#         e.g. my_str = f"{Fg.BLUE}hello{Fg.RESET}"
#         """
#         return f"{CSI}{self.value}m"
# 
# def style(
#     value: Any,
#     *,
#     fg: Optional[FgColor] = None,
#     bg: Optional[BgColor] = None,
#     bold: Optional[bool] = None,
#     dim: Optional[bool] = None,
#     italic: Optional[bool] = None,
#     overline: Optional[bool] = None,
#     strikethrough: Optional[bool] = None,
#     underline: Optional[bool] = None,
# ) -> str:
#     """
#     Apply ANSI colors and/or styles to a string and return it.
#     The styling is self contained which means that at the end of the string reset code(s) are issued
#     to undo whatever styling was done at the beginning.
# 
#     :param value: object whose text is to be styled
#     :param fg: foreground color provided as any subclass of FgColor (e.g. Fg, EightBitFg, RgbFg)
#                Defaults to no color.
#     :param bg: foreground color provided as any subclass of BgColor (e.g. Bg, EightBitBg, RgbBg)
#                Defaults to no color.
#     :param bold: apply the bold style if True. Defaults to False.
#     :param dim: apply the dim style if True. Defaults to False.
#     :param italic: apply the italic style if True. Defaults to False.
#     :param overline: apply the overline style if True. Defaults to False.
#     :param strikethrough: apply the strikethrough style if True. Defaults to False.
#     :param underline: apply the underline style if True. Defaults to False.
#     :raises: TypeError if fg isn't None or a subclass of FgColor
#     :raises: TypeError if bg isn't None or a subclass of BgColor
#     :return: the stylized string
#     """
#     # List of strings that add style
#     additions: List[AnsiSequence] = []
# 
#     # List of strings that remove style
#     removals: List[AnsiSequence] = []
# 
#     # Process the style settings
#     if fg is not None:
#         if not isinstance(fg, FgColor):
#             raise TypeError("fg must be a subclass of FgColor")
#         additions.append(fg)
#         removals.append(Fg.RESET)
# 
#     if bg is not None:
#         if not isinstance(bg, BgColor):
#             raise TypeError("bg must a subclass of BgColor")
#         additions.append(bg)
#         removals.append(Bg.RESET)
# 
#     if bold:
#         additions.append(TextStyle.INTENSITY_BOLD)
#         removals.append(TextStyle.INTENSITY_NORMAL)
# 
#     if dim:
#         additions.append(TextStyle.INTENSITY_DIM)
#         removals.append(TextStyle.INTENSITY_NORMAL)
# 
#     if italic:
#         additions.append(TextStyle.ITALIC_ENABLE)
#         removals.append(TextStyle.ITALIC_DISABLE)
# 
#     if overline:
#         additions.append(TextStyle.OVERLINE_ENABLE)
#         removals.append(TextStyle.OVERLINE_DISABLE)
# 
#     if strikethrough:
#         additions.append(TextStyle.STRIKETHROUGH_ENABLE)
#         removals.append(TextStyle.STRIKETHROUGH_DISABLE)
# 
#     if underline:
#         additions.append(TextStyle.UNDERLINE_ENABLE)
#         removals.append(TextStyle.UNDERLINE_DISABLE)
# 
#     # Combine the ANSI style sequences with the value's text
#     return "".join(map(str, additions)) + str(value) + "".join(map(str, removals))


import random
import threading
import time
import cmd2
    import sys
from typing import (
    List,
)
from cmd2 import (
    Fg,
    style,
)
        for i, cur_alert in enumerate(alerts):
            # Use padding to center the alert
            padding = ' ' * int((num_asterisks - len(cur_alert)) / 2)

            if i > 0:
                alert_str += '\n'
            alert_str += '*' * num_asterisks + '\n'
            alert_str += padding + cur_alert + padding + '\n'
            alert_str += '*' * num_asterisks + '\n'

        return alert_str

    def _generate_colored_prompt(self) -> str:
        """
        Randomly generates a colored prompt
        :return: the new prompt
        """
        rand_num = random.randint(1, 20)

        status_color = Fg.RESET

        if rand_num == 1:
            status_color = Fg.LIGHT_RED
        elif rand_num == 2:
            status_color = Fg.LIGHT_YELLOW
        elif rand_num == 3:
            status_color = Fg.CYAN
        elif rand_num == 4:
            status_color = Fg.LIGHT_GREEN
        elif rand_num == 5:

# Path: cmd2/ansi.py
# class Fg(FgColor, Enum):
#     """
#     Create ANSI sequences for the 16 standard terminal foreground text colors.
#     A terminal's color settings affect how these colors appear.
#     To reset any foreground color, use Fg.RESET.
#     """
# 
#     BLACK = 30
#     RED = 31
#     GREEN = 32
#     YELLOW = 33
#     BLUE = 34
#     MAGENTA = 35
#     CYAN = 36
#     LIGHT_GRAY = 37
#     DARK_GRAY = 90
#     LIGHT_RED = 91
#     LIGHT_GREEN = 92
#     LIGHT_YELLOW = 93
#     LIGHT_BLUE = 94
#     LIGHT_MAGENTA = 95
#     LIGHT_CYAN = 96
#     WHITE = 97
# 
#     RESET = 39
# 
#     def __str__(self) -> str:
#         """
#         Return ANSI color sequence instead of enum name
#         This is helpful when using an Fg in an f-string or format() call
#         e.g. my_str = f"{Fg.BLUE}hello{Fg.RESET}"
#         """
#         return f"{CSI}{self.value}m"
# 
# def style(
#     value: Any,
#     *,
#     fg: Optional[FgColor] = None,
#     bg: Optional[BgColor] = None,
#     bold: Optional[bool] = None,
#     dim: Optional[bool] = None,
#     italic: Optional[bool] = None,
#     overline: Optional[bool] = None,
#     strikethrough: Optional[bool] = None,
#     underline: Optional[bool] = None,
# ) -> str:
#     """
#     Apply ANSI colors and/or styles to a string and return it.
#     The styling is self contained which means that at the end of the string reset code(s) are issued
#     to undo whatever styling was done at the beginning.
# 
#     :param value: object whose text is to be styled
#     :param fg: foreground color provided as any subclass of FgColor (e.g. Fg, EightBitFg, RgbFg)
#                Defaults to no color.
#     :param bg: foreground color provided as any subclass of BgColor (e.g. Bg, EightBitBg, RgbBg)
#                Defaults to no color.
#     :param bold: apply the bold style if True. Defaults to False.
#     :param dim: apply the dim style if True. Defaults to False.
#     :param italic: apply the italic style if True. Defaults to False.
#     :param overline: apply the overline style if True. Defaults to False.
#     :param strikethrough: apply the strikethrough style if True. Defaults to False.
#     :param underline: apply the underline style if True. Defaults to False.
#     :raises: TypeError if fg isn't None or a subclass of FgColor
#     :raises: TypeError if bg isn't None or a subclass of BgColor
#     :return: the stylized string
#     """
#     # List of strings that add style
#     additions: List[AnsiSequence] = []
# 
#     # List of strings that remove style
#     removals: List[AnsiSequence] = []
# 
#     # Process the style settings
#     if fg is not None:
#         if not isinstance(fg, FgColor):
#             raise TypeError("fg must be a subclass of FgColor")
#         additions.append(fg)
#         removals.append(Fg.RESET)
# 
#     if bg is not None:
#         if not isinstance(bg, BgColor):
#             raise TypeError("bg must a subclass of BgColor")
#         additions.append(bg)
#         removals.append(Bg.RESET)
# 
#     if bold:
#         additions.append(TextStyle.INTENSITY_BOLD)
#         removals.append(TextStyle.INTENSITY_NORMAL)
# 
#     if dim:
#         additions.append(TextStyle.INTENSITY_DIM)
#         removals.append(TextStyle.INTENSITY_NORMAL)
# 
#     if italic:
#         additions.append(TextStyle.ITALIC_ENABLE)
#         removals.append(TextStyle.ITALIC_DISABLE)
# 
#     if overline:
#         additions.append(TextStyle.OVERLINE_ENABLE)
#         removals.append(TextStyle.OVERLINE_DISABLE)
# 
#     if strikethrough:
#         additions.append(TextStyle.STRIKETHROUGH_ENABLE)
#         removals.append(TextStyle.STRIKETHROUGH_DISABLE)
# 
#     if underline:
#         additions.append(TextStyle.UNDERLINE_ENABLE)
#         removals.append(TextStyle.UNDERLINE_DISABLE)
# 
#     # Combine the ANSI style sequences with the value's text
#     return "".join(map(str, additions)) + str(value) + "".join(map(str, removals))


# Path: examples/async_printing.py
import random
import threading
import time
import cmd2
    import sys
from typing import (
    List,
)
from cmd2 import (
    Fg,
    style,
)

        for i, cur_alert in enumerate(alerts):
            # Use padding to center the alert
            padding = ' ' * int((num_asterisks - len(cur_alert)) / 2)

            if i > 0:
                alert_str += '\n'
            alert_str += '*' * num_asterisks + '\n'
            alert_str += padding + cur_alert + padding + '\n'
            alert_str += '*' * num_asterisks + '\n'

        return alert_str

    def _generate_colored_prompt(self) -> str:
        """
        Randomly generates a colored prompt
        :return: the new prompt
        """
        rand_num = random.randint(1, 20)

        status_color = Fg.RESET

        if rand_num == 1:
            status_color = Fg.LIGHT_RED
        elif rand_num == 2:
            status_color = Fg.LIGHT_YELLOW
        elif rand_num == 3:
            status_color = Fg.CYAN
        elif rand_num == 4:
            status_color = Fg.LIGHT_GREEN
        elif rand_num == 5:

            status_color = Fg.LIGHT_BLUE