NodesGroup.group_by

NodesGroup.group_by(key)[source]

Group members into multiple subgroups based on a key function.

Parameters:
keyCallable[[_MemberType], Any]

A function that extracts a key from a member for grouping.

Returns:
Dict[Any, G]

A dictionary where keys are the grouping values and values are group instances of the same type as self.