def METHOD_NAME(cls, colour_class: str, text: str) -> str:
    """Return a colourized version of text, using colour_class."""
    colour = cls._COLOURING[colour_class]
    new_text = text.replace(" ", cls._SPACE)
    if "-line" not in colour_class:
        new_text = highlight(
            new_text,
            PythonLexer(),
            HtmlFormatter(nowrap=True, lineseparator="", classprefix="pygments-"),
        )
    return colour + new_text + cls._COLOURING["reset"]