# Path: ros2_batch_job/vendor/osrf_pycommon/osrf_pycommon/terminal_color/ansi_re.py
# def split_by_ansi_escape_sequence(string, include_delimiters=False):
#     """
#     Splits a string into a list using any ansi escape sequence as a delimiter.
# 
#     :param string: string to be split
#     :type string: str
#     :param include_delimiters: If True include matched escape sequences in
#         the list (default: False)
#     :type include_delimiters: bool
#     :returns: list of strings, split from original string by escape sequences
#     :rtype: list
#     """
#     global _ansi_re, _ansi_re_group
#     if include_delimiters:
#         return _ansi_re_group.split(string)
#     return _ansi_re.split(string)


import ctypes
    import ctypes.wintypes
import os
import sys
from .ansi_re import split_by_ansi_escape_sequence
    '\x1b[0m': (_win_reset, ),          # reset
    '\x1b[1m': (_win_style, BRIGHT),    # boldon, see wincon.h
    '\x1b[22m': (_win_style, NORMAL),   # boldoff, see wincon.h
    '\x1b[3m': (_win_style, None),      # italicson, nothing on Windows
    '\x1b[23m': (_win_style, None),     # italicsoff, nothing on Windows
    '\x1b[4m': (_win_style, None),      # ulon, nothing on Windows
    '\x1b[24m': (_win_style, None),     # uloff, nothing on Windows
    '\x1b[7m': (_win_style, None),      # invon, nothing on Windows
    '\x1b[27m': (_win_style, None),     # invoff, nothing on Windows
    '\x1b[30m': (_win_foreground, 0),   # blackf
    '\x1b[40m': (_win_background, 0),   # blackb
    '\x1b[34m': (_win_foreground, 1),   # bluef
    '\x1b[44m': (_win_background, 1),   # blueb
    '\x1b[32m': (_win_foreground, 2),   # greenf
    '\x1b[42m': (_win_background, 2),   # greenb
    '\x1b[36m': (_win_foreground, 3),   # cyanf
    '\x1b[46m': (_win_background, 3),   # cyanb
    '\x1b[31m': (_win_foreground, 4),   # redf
    '\x1b[41m': (_win_background, 4),   # redb
    '\x1b[35m': (_win_foreground, 5),   # purplef
    '\x1b[45m': (_win_background, 5),   # purpleb
    '\x1b[33m': (_win_foreground, 6),   # yellowf
    '\x1b[43m': (_win_background, 6),   # yellowb
    '\x1b[37m': (_win_foreground, 7),   # whitef
    '\x1b[47m': (_win_background, 7),   # whiteb
}


def _tokenize_ansi_string_for_win32(msg):
    global _ansi_to_win32

# Path: ros2_batch_job/vendor/osrf_pycommon/osrf_pycommon/terminal_color/ansi_re.py
# def split_by_ansi_escape_sequence(string, include_delimiters=False):
#     """
#     Splits a string into a list using any ansi escape sequence as a delimiter.
# 
#     :param string: string to be split
#     :type string: str
#     :param include_delimiters: If True include matched escape sequences in
#         the list (default: False)
#     :type include_delimiters: bool
#     :returns: list of strings, split from original string by escape sequences
#     :rtype: list
#     """
#     global _ansi_re, _ansi_re_group
#     if include_delimiters:
#         return _ansi_re_group.split(string)
#     return _ansi_re.split(string)


# Path: ros2_batch_job/vendor/osrf_pycommon/osrf_pycommon/terminal_color/windows.py
import ctypes
    import ctypes.wintypes
import os
import sys
from .ansi_re import split_by_ansi_escape_sequence

    '\x1b[0m': (_win_reset, ),          # reset
    '\x1b[1m': (_win_style, BRIGHT),    # boldon, see wincon.h
    '\x1b[22m': (_win_style, NORMAL),   # boldoff, see wincon.h
    '\x1b[3m': (_win_style, None),      # italicson, nothing on Windows
    '\x1b[23m': (_win_style, None),     # italicsoff, nothing on Windows
    '\x1b[4m': (_win_style, None),      # ulon, nothing on Windows
    '\x1b[24m': (_win_style, None),     # uloff, nothing on Windows
    '\x1b[7m': (_win_style, None),      # invon, nothing on Windows
    '\x1b[27m': (_win_style, None),     # invoff, nothing on Windows
    '\x1b[30m': (_win_foreground, 0),   # blackf
    '\x1b[40m': (_win_background, 0),   # blackb
    '\x1b[34m': (_win_foreground, 1),   # bluef
    '\x1b[44m': (_win_background, 1),   # blueb
    '\x1b[32m': (_win_foreground, 2),   # greenf
    '\x1b[42m': (_win_background, 2),   # greenb
    '\x1b[36m': (_win_foreground, 3),   # cyanf
    '\x1b[46m': (_win_background, 3),   # cyanb
    '\x1b[31m': (_win_foreground, 4),   # redf
    '\x1b[41m': (_win_background, 4),   # redb
    '\x1b[35m': (_win_foreground, 5),   # purplef
    '\x1b[45m': (_win_background, 5),   # purpleb
    '\x1b[33m': (_win_foreground, 6),   # yellowf
    '\x1b[43m': (_win_background, 6),   # yellowb
    '\x1b[37m': (_win_foreground, 7),   # whitef
    '\x1b[47m': (_win_background, 7),   # whiteb
}


def _tokenize_ansi_string_for_win32(msg):
    global _ansi_to_win32

    tokens = filter(None, split_by_ansi_escape_sequence(msg, True))