Repository: ManimCommunity/manim
File: manim/mobject/text/code_mobject.py (Python)

Code before:
        'aliases or short names'.
    generate_html_file
        Defines whether to generate highlighted html code to the folder `assets/codes/generated_html_files`. Defaults to `False`.
    warn_missing_font
        If True (default), Manim will issue a warning if the font does not exist in the
        (case-sensitive) list of fonts returned from `manimpango.list_fonts()`.

    Attributes
    ----------
    background_mobject : :class:`~.VGroup`
        The background of the code listing.
    line_numbers : :class:`~.Paragraph`
        The line numbers for the code listing. Empty, if
        ``insert_line_no=False`` has been specified.
    code : :class:`~.Paragraph`
        The highlighted code.

    """

    # tuples in the form (name, aliases, filetypes, mimetypes)
    # 'language' is aliases or short names
    # For more information about pygments.lexers visit https://pygments.org/docs/lexers/
    # from pygments.lexers import get_all_lexers
    # all_lexers = get_all_lexers()
    # styles_list = list(get_all_styles())
    _styles_list_cache = None
    # For more information about pygments.styles visit https://pygments.org/docs/styles/

    def __init__(
        self,
        file_name: str | os.PathLike | None = None,
        code: str | None = None,
        tab_width: int = 3,
        line_spacing: float = 0.3,
        font_size: float = 24,
        font: str = "Monospace",  # This should be in the font list on all platforms.
        stroke_width: float = 0,
        margin: float = 0.3,
        indentation_chars: str = "    ",
        background: str = "rectangle",  # or window
        background_stroke_width: float = 1,
        background_stroke_color: str = WHITE,
        corner_radius: float = 0.2,
        insert_line_no: bool = True,
        line_no_from: int = 1,
        line_no_buff: float = 0.4,
        style: str = "vim",
        language: str | None = None,
        generate_html_file: bool = False,
        warn_missing_font: bool = True,
        **kwargs,

Review comment (performance):
```suggestion
    _styles_list_cache: list[str] | None = None
```
Always helps to keep a nicely typed library!

Code after:
        'aliases or short names'.
    generate_html_file
        Defines whether to generate highlighted html code to the folder `assets/codes/generated_html_files`. Defaults to `False`.
    warn_missing_font
        If True (default), Manim will issue a warning if the font does not exist in the
        (case-sensitive) list of fonts returned from `manimpango.list_fonts()`.

    Attributes
    ----------
    background_mobject : :class:`~.VGroup`
        The background of the code listing.
    line_numbers : :class:`~.Paragraph`
        The line numbers for the code listing. Empty, if
        ``insert_line_no=False`` has been specified.
    code : :class:`~.Paragraph`
        The highlighted code.

    """

    # tuples in the form (name, aliases, filetypes, mimetypes)
    # 'language' is aliases or short names
    # For more information about pygments.lexers visit https://pygments.org/docs/lexers/
    # from pygments.lexers import get_all_lexers
    # all_lexers = get_all_lexers()
    _styles_list_cache: list[str] | None = None
    # For more information about pygments.styles visit https://pygments.org/docs/styles/

    def __init__(
        self,
        file_name: str | os.PathLike | None = None,
        code: str | None = None,
        tab_width: int = 3,
        line_spacing: float = 0.3,
        font_size: float = 24,
        font: str = "Monospace",  # This should be in the font list on all platforms.
        stroke_width: float = 0,
        margin: float = 0.3,
        indentation_chars: str = "    ",
        background: str = "rectangle",  # or window
        background_stroke_width: float = 1,
        background_stroke_color: str = WHITE,
        corner_radius: float = 0.2,
        insert_line_no: bool = True,
        line_no_from: int = 1,
        line_no_buff: float = 0.4,
        style: str = "vim",
        language: str | None = None,
        generate_html_file: bool = False,
        warn_missing_font: bool = True,
        **kwargs,
    ):