def get_colored_string(msg, color):
    if not stdout.isatty():
        return msg

    colors = {
        GREEN_COLOR: '\033[92m',
        YELLOW_COLOR: '\033[93m',
        RED_COLOR: '\033[91m',}
    ENDC = '\033[0m'
    return '%s%s%s' % (colors[color], msg, ENDC)
Returns colored message with ANSI escape sequences for terminal.
dataset/ETHPy150Open openlmi/openlmi-scripts/commands/system/lmi/scripts/system/__init__.py/get_colored_string