def get_panel_groups_at_depth(group, depth=0):
    """Return a list of the panel groups at a certain depth below the node group"""
    assert depth >= 0
    if depth == 0:
        return [group]
    else:
        assert group.is_group()
        return [
            p
            for gp in group.children()
            for p in get_panel_groups_at_depth(gp, depth - 1)
        ]