def process_selected(keypath, selected_subtree):
          """Processes one of the selected subtrees."""
          if absolute_keypath:
            # Start with this selection's keypath
            _, result = process_subtree(keypath, selected_subtree)
            return result
          else:
            # Start with the empty keypath (relative to this selection)
            _, result = process_subtree((), selected_subtree)
            return result
Processes one of the selected subtrees.
penzai/core/selectors.py