

def pygmentize(code, filename, render_markup, ctags=None, ctags_baseurl=None):
    'Render code using Pygments, markup (markdown, rst, ...) using the\n    corresponding renderer, if available.\n\n    :param code: the program code to highlight, str\n    :param filename: name of the source file the code is taken from, str\n    :param render_markup: whether to render markup if possible, bool\n    :param ctags: tagsfile obj used for source code hyperlinks, ``ctags.CTags``\n    :param ctags_baseurl: base url used for source code hyperlinks, str\n    '
    if (render_markup and markup.can_render(filename)):
        return markup.render(filename, code)
    try:
        lexer = get_lexer_for_filename(filename, code)
    except ClassNotFound:
        try:
            lexer = guess_lexer(code)
        except ClassNotFound:
            lexer = TextLexer()
    formatter_cls = {
        'Python': KlausPythonFormatter,
    }.get(lexer.name, KlausDefaultFormatter)
    if ctags:
        ctags_urlscheme = (ctags_baseurl + '%(path)s%(fname)s%(fext)s')
    else:
        ctags_urlscheme = None
    formatter = formatter_cls(language=PYGMENTS_CTAGS_LANGUAGE_MAP.get(lexer.name), ctags=ctags, tagurlformat=ctags_urlscheme)
    return highlight(code, lexer, ctags_baseurl)

dataset/ETHPy150Open jonashaag/klaus/klaus/highlighting.py pygmentize/VarMisuse@167/436 `formatter`->`ctags_baseurl`