class_docstr: A mutable DOM element that displays code as HTML.
class_docstr_tok: ["A","mutable","DOM","element","that","displays","code","as","HTML","."]
code: def _highlight_code(self, code: str, highlights, linenostart: int):
      is_dark_mode = output.eval_js(
          'document.documentElement.matches("[theme=dark]");'
      )
      code_style = "monokai" if is_dark_mode else "default"
      hl_color = "#4e56b7" if is_dark_mode else "#fff7c1"
      if IS_PYGMENTS_ENABLED:
          lexer = pygments.lexers.get_lexer_by_name("python")
          formatter = pygments.formatters.HtmlFormatter(
              full=False,
              hl_lines=highlights,
              linenos=True,
              linenostart=linenostart,
              style=code_style,
          )
          if hl_color:
              formatter.style.highlight_color = hl_color
          css_ = formatter.get_style_defs()
          code = pygments.highlight(code, lexer, formatter)
      else:
          return ""
      return code, css_
  
imports: from __future__ import annotations
  import html
  import inspect
  import traceback
  import uuid
  from jax._src.debugger import colab_lib
  from jax._src.debugger import core
  from jax._src.debugger import cli_debugger
label_desc: Use image node_id 6 for calling the CodeViewer obj's underlying member method code with example usage: obj._highlight_code(code, highlights, linenostart) and returns: code,  css_, str