def display(
    value: Any,
    ignore_exceptions: bool = False,
    roundtrip_mode: bool = False,
):
  """Displays a value as an interactively foldable object.

  This is a compatibility wrapper for `treescope.display`, which also formats
  objects implementing the old `__penzai_repr__` method. Consider using
  `treescope.display` directly instead.

  Args:
    value: Value to fold.
    ignore_exceptions: Whether to catch errors during rendering of subtrees and
      show a fallback for those subtrees.
    roundtrip_mode: Whether to start in roundtrip mode.

  Raises:
    RuntimeError: If IPython is not available.
  """
  with treescope.active_renderer.set_scoped(
      _active_renderer_extended_with_penzai_repr()
  ):
    treescope.display(
        value,
        ignore_exceptions=ignore_exceptions,
        roundtrip_mode=roundtrip_mode,
    )
Displays a value as an interactively foldable object.

  This is a compatibility wrapper for `treescope.display`, which also formats
  objects implementing the old `__penzai_repr__` method. Consider using
  `treescope.display` directly instead.

  Args:
    value: Value to fold.
    ignore_exceptions: Whether to catch errors during rendering of subtrees and
      show a fallback for those subtrees.
    roundtrip_mode: Whether to start in roundtrip mode.

  Raises:
    RuntimeError: If IPython is not available.
  
penzai/treescope/_compatibility_setup.py