group_keys

group_keys(keys: list[str]) dict[str, list[str]][source]

Group keys based on individual key parts.

A key is composed of parts separated by a single underscores (_). Keys are grouped such that each key group consists of the subset of keys with the matching part at the given position.

Returns:

The map of key groups to keys.