(
    *,
    tokens: List[_PrettyToken],
    font_bold: Optional[Callable[[str], str]] = None,
    font_dim: Optional[Callable[[str], str]] = None,
    font_red: Optional[Callable[[str], str]] = None,
    font_blue: Optional[Callable[[str], str]] = None,
    font_normal: Optional[Callable[[str], str]] = None,
)
return ''.join(result)
`_tokenize_large_file_content` generate the result string. It is colored.
`_tokenize_large_file_content` generate the result string. It is colored.
_tokenize_large_file_content generate the result string . It is colored .
def _render_tokens(
    *,
    tokens: List[_PrettyToken],
    font_bold: Optional[Callable[[str], str]] = None,
    font_dim: Optional[Callable[[str], str]] = None,
    font_red: Optional[Callable[[str], str]] = None,
    font_blue: Optional[Callable[[str], str]] = None,
    font_normal: Optional[Callable[[str], str]] = None,
) -> str:
    """`_tokenize_large_file_content` generate the result string. It is colored.
    """

    if font_bold is None:
        font_bold = lambda s: colorama.Style.BRIGHT + s + colorama.Style.RESET_ALL
    if font_dim is None:
        font_dim = lambda s: colorama.Style.DIM + s + colorama.Style.RESET_ALL
    if font_red is None:
        font_red = lambda s: colorama.Fore.RED + s + colorama.Style.RESET_ALL
    if font_blue is None:
        font_blue = lambda s: colorama.Fore.CYAN + s + colorama.Style.RESET_ALL
    if font_normal is None:
        font_normal = lambda s: s

    result = []
    for key, value in tokens:
        if key == _PrettyTokenType.BODY:
            value = font_bold(value)
        elif key == _PrettyTokenType.BODY_HIGHLIGHT_LEFT:
            value = font_red(value)
        elif key == _PrettyTokenType.BODY_HIGHLIGHT_RIGHT:
            value = font_red(value)
        elif key == _PrettyTokenType.WHITESPACE:
            value = font_dim(_replace_whitespace(value))
        elif key == _PrettyTokenType.NEWLINE:
            value = font_dim(_replace_whitespace(value))
        elif key == _PrettyTokenType.HINT:
            value = font_dim(value)
        elif key == _PrettyTokenType.LINENO:
            value = font_blue(value)
        elif key == _PrettyTokenType.OTHERS:
            value = font_normal(value)
        else:
            assert False
        result.append(value)
    return ''.join(result)
def _render_tokens ( * , tokens : List [ _PrettyToken ] , font_bold : Optional [ Callable [ [ str ] , str ] ] = None , font_dim : Optional [ Callable [ [ str ] , str ] ] = None , font_red : Optional [ Callable [ [ str ] , str ] ] = None , font_blue : Optional [ Callable [ [ str ] , str ] ] = None , font_normal : Optional [ Callable [ [ str ] , str ] ] = None , ) -> str : if font_bold is None : font_bold = lambda s : colorama . Style . BRIGHT + s + colorama . Style . RESET_ALL if font_dim is None : font_dim = lambda s : colorama . Style . DIM + s + colorama . Style . RESET_ALL if font_red is None : font_red = lambda s : colorama . Fore . RED + s + colorama . Style . RESET_ALL if font_blue is None : font_blue = lambda s : colorama . Fore . CYAN + s + colorama . Style . RESET_ALL if font_normal is None : font_normal = lambda s : s result = [ ] for key , value in tokens : if key == _PrettyTokenType . BODY : value = font_bold ( value ) elif key == _PrettyTokenType . BODY_HIGHLIGHT_LEFT : value = font_red ( value ) elif key == _PrettyTokenType . BODY_HIGHLIGHT_RIGHT : value = font_red ( value ) elif key == _PrettyTokenType . WHITESPACE : value = font_dim ( _replace_whitespace ( value ) ) elif key == _PrettyTokenType . NEWLINE : value = font_dim ( _replace_whitespace ( value ) ) elif key == _PrettyTokenType . HINT : value = font_dim ( value ) elif key == _PrettyTokenType . LINENO : value = font_blue ( value ) elif key == _PrettyTokenType . OTHERS : value = font_normal ( value ) else : assert False result . append ( value ) return '' . join ( result )