def __treescope_root_repr__(self):
    """Renders this selection as the root object in a treescope rendering."""
    from penzai.core._treescope_handlers import selection_rendering  # pylint: disable=import-outside-toplevel

    return selection_rendering.render_selection_to_foldable_representation(
        self, visible_selection=True, ignore_exceptions=True
    )
Renders this selection as the root object in a treescope rendering.
penzai/core/selectors.py