def set_sequence(self, replacements: Iterable[Any]) -> Any:
    """Replaces the selected subtree(s) in order.

    Args:
      replacements: An iterable of PyTrees to insert at the selected locations,
        in order.

    Returns:
      A modified version of the original tree, with replacements taken from the
      iterable.
    """
    replacer = {}
    for keypath, replacement in zip(self.selected_by_path.keys(), replacements):
      replacer[keypath] = replacement
    return self.set_by_path(replacer)
Replaces the selected subtree(s) in order.

    Args:
      replacements: An iterable of PyTrees to insert at the selected locations,
        in order.

    Returns:
      A modified version of the original tree, with replacements taken from the
      iterable.
    
penzai/core/selectors.py