I would have thought that if `type` equals `static` only static groups would be displayed?

Perhaps `type` should default to `None` which displays all groups and there should be an additional `if type == 'static':` branch in the `if / else`?