# Path: clearly/utils/colors.py
# class Colors:
#     BLUE = color_factory('\033[94m')
#     GREEN = color_factory('\033[92m')
#     YELLOW = color_factory('\033[93m')
#     RED = color_factory('\033[91m')
#     MAGENTA = color_factory('\033[95m')
#     CYAN = color_factory('\033[96m')
#     ORANGE = color_factory('\033[38;5;208m')
# 
#     BOLD = color_factory('\033[1m')
#     DIM = color_factory('\033[2m')
# 
#     BLUE_BOLD, BLUE_DIM = BLUE.mix(BOLD, DIM)
#     GREEN_BOLD, GREEN_DIM = GREEN.mix(BOLD, DIM)
#     YELLOW_BOLD, YELLOW_DIM = YELLOW.mix(BOLD, DIM)
#     RED_BOLD, RED_DIM = RED.mix(BOLD, DIM)
#     MAGENTA_BOLD, MAGENTA_DIM = MAGENTA.mix(BOLD, DIM)
#     CYAN_BOLD, CYAN_DIM = CYAN.mix(BOLD, DIM)
#     ORANGE_BOLD, ORANGE_DIM = ORANGE.mix(BOLD, DIM)
# 
# Path: clearly/utils/safe_compiler.py
# NON_PRINTABLE_PATTERN = re.compile('[\x00-\x1f]')
# def safe_compile_text(txt: str, raises: bool = False) -> Any:
#     def _convert(node):
# def _encode_to_hex(match: Match) -> str:


from typing import Any, Callable
from ..utils.colors import Colors
from ..utils.safe_compiler import CallDescriptor
    from pygments.lexers.python import PythonTracebackLexer
    from pygments.formatters.terminal256 import Terminal256Formatter
    from pygments import highlight
        return Colors.GREEN(str(p))

    if isinstance(p, CallDescriptor):
        func_args = typed_code(p.args, wrap=False) if p.args else ''
        if p.kwargs:
            if p.args:
                func_args += SEPARATOR
            func_args += typed_code(p.kwargs, wrap=False)
        return '{}({})'.format(p.name, func_args)

    if isinstance(p, list):
        f = '[{}]' if wrap else '{}'
        return f.format(SEPARATOR.join(typed_code(x) for x in p))

    if isinstance(p, set):
        return '{{{}}}'.format(typed_code(sorted(p, key=lambda x: str(x)), wrap=False))

    if isinstance(p, tuple):
        if wrap:
            f = '({})' if len(p) != 1 else '({},)'
        else:
            f = '{}'
        return f.format(SEPARATOR.join(typed_code(x) for x in p))

    if isinstance(p, dict):
        if wrap:
            f = '{{{}}}'
            sep = DICT_SEPARATOR

            def key(k):

# Path: clearly/utils/colors.py
# class Colors:
#     BLUE = color_factory('\033[94m')
#     GREEN = color_factory('\033[92m')
#     YELLOW = color_factory('\033[93m')
#     RED = color_factory('\033[91m')
#     MAGENTA = color_factory('\033[95m')
#     CYAN = color_factory('\033[96m')
#     ORANGE = color_factory('\033[38;5;208m')
# 
#     BOLD = color_factory('\033[1m')
#     DIM = color_factory('\033[2m')
# 
#     BLUE_BOLD, BLUE_DIM = BLUE.mix(BOLD, DIM)
#     GREEN_BOLD, GREEN_DIM = GREEN.mix(BOLD, DIM)
#     YELLOW_BOLD, YELLOW_DIM = YELLOW.mix(BOLD, DIM)
#     RED_BOLD, RED_DIM = RED.mix(BOLD, DIM)
#     MAGENTA_BOLD, MAGENTA_DIM = MAGENTA.mix(BOLD, DIM)
#     CYAN_BOLD, CYAN_DIM = CYAN.mix(BOLD, DIM)
#     ORANGE_BOLD, ORANGE_DIM = ORANGE.mix(BOLD, DIM)
# 
# Path: clearly/utils/safe_compiler.py
# NON_PRINTABLE_PATTERN = re.compile('[\x00-\x1f]')
# def safe_compile_text(txt: str, raises: bool = False) -> Any:
#     def _convert(node):
# def _encode_to_hex(match: Match) -> str:


# Path: clearly/client/code_highlighter.py
from typing import Any, Callable
from ..utils.colors import Colors
from ..utils.safe_compiler import CallDescriptor
    from pygments.lexers.python import PythonTracebackLexer
    from pygments.formatters.terminal256 import Terminal256Formatter
    from pygments import highlight

        return Colors.GREEN(str(p))

    if isinstance(p, CallDescriptor):
        func_args = typed_code(p.args, wrap=False) if p.args else ''
        if p.kwargs:
            if p.args:
                func_args += SEPARATOR
            func_args += typed_code(p.kwargs, wrap=False)
        return '{}({})'.format(p.name, func_args)

    if isinstance(p, list):
        f = '[{}]' if wrap else '{}'
        return f.format(SEPARATOR.join(typed_code(x) for x in p))

    if isinstance(p, set):
        return '{{{}}}'.format(typed_code(sorted(p, key=lambda x: str(x)), wrap=False))

    if isinstance(p, tuple):
        if wrap:
            f = '({})' if len(p) != 1 else '({},)'
        else:
            f = '{}'
        return f.format(SEPARATOR.join(typed_code(x) for x in p))

    if isinstance(p, dict):
        if wrap:
            f = '{{{}}}'
            sep = DICT_SEPARATOR

            def key(k):

                return typed_code(k)