def format_code(code):
    pp = Python3Lexer()
    tokens = pp.get_tokens(code)
    formatted = ''
    for (token, string) in tokens:
        updated = False
        for (span_class, checker) in tokenizer_map.items():
            if checker(token):
                formatted += f'<span class="token {span_class}">{string}</span>'
                updated = True
                break
        if (not updated):
            formatted += string
    return formatted
def format_code(code):
    pp = Python3Lexer()
    tokens = pp.get_tokens(code)
    formatted = 
    for (token, string) in tokens:
        updated = False
        for (span_class, checker) in tokenizer_map.items():
            if checker(token):
                formatted += f'<span class="token {span_class}">{string}</span>'
                updated = True
                break
        if (not updated):
            formatted += string
    return formatted