def groups(self):
        """
        returns list of visible groups.
        The existing groups are filtered by the visible_groups attribute and
        their label. Groups with an empty string as label are never contained.
        Groups that are not named in visible_groups are not returned.
        """
        groups = filter(lambda g: g.label, self.qtile.groups)

        if self.hide_unused:
            groups = filter(lambda g: g.windows or g.screen, groups)

        if self.visible_groups:
            groups = filter(lambda g: g.name in self.visible_groups, groups)

        return list(groups)

        returns list of visible groups.
        The existing groups are filtered by the visible_groups attribute and
        their label. Groups with an empty string as label are never contained.
        Groups that are not named in visible_groups are not returned.
        
libqtile/widget/groupbox.py