class_docstr: Displays information about a stack frame.
class_docstr_tok: ["Displays","information","about","a","stack","frame","."]
docstr: Updates the frame viewer to use a new frame.
docstr_tok: ["Updates","the","frame","viewer","to","use","a","new","frame","."]
code: def update_frame(self, frame):
      """Updates the frame viewer to use a new frame."""
      self.frame = frame
      lineno = self.frame.lineno or None
      filename = self.frame.filename.strip()
      if inspect.getmodulename(filename):
          if filename not in self._file_cache:
              try:
                  with open(filename) as fp:
                      self._file_cache[filename] = fp.read()
                  source = self._file_cache[filename]
                  highlight = lineno
                  linenostart = 1
              except FileNotFoundError:
                  source = "\n".join(frame.source)
                  highlight = min(
                      frame.offset + 1, len(frame.source) - 1
                  )
                  linenostart = lineno - frame.offset
      else:
          source = "\n".join(frame.source)
          highlight = min(frame.offset + 1, len(frame.source) - 1)
          linenostart = lineno - frame.offset
      self._header.clear()
      self._header.update(
          colab_lib.div(
              colab_lib.pre(
                  colab_lib.code(f"{html.escape(filename)}({lineno})")
              ),
              style=colab_lib.style(
                  {
                      "padding": "5px 5px 5px 5px",
                      "background-color": "var(--colab-highlighted-surface-color)",
                  }
              ),
          )
      )
      self._code_view.update_code(
          source, [highlight], linenostart=linenostart
      )
  
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 5 for calling the FramePreview obj's underlying member method code with example usage: obj.update_frame(frame) without return types