def free_effect_types(model_tree: Any) -> list[type[Any]]:
  """Collects the effect types of all `EffectRequest` nodes in a (sub)model.

  Args:
    model_tree: A pytree for a model or submodel.

  Returns:
    A list of the effect protocol types for all `EffectRequest` nodes that
    appear in a model or submodel.
  """
  results = ordered_set.OrderedSet()

  def _go(eff_request: EffectRequest):
    results.add(type(eff_request).effect_protocol())

  selectors.select(model_tree).at_instances_of(EffectRequest).apply(_go)
  return list(results)
Collects the effect types of all `EffectRequest` nodes in a (sub)model.

  Args:
    model_tree: A pytree for a model or submodel.

  Returns:
    A list of the effect protocol types for all `EffectRequest` nodes that
    appear in a model or submodel.
  
penzai/deprecated/v1/data_effects/effect_base.py