def toggle_group(self, group_name: str | None = None, warp: bool = True) -> None:
        """Switch to the selected group or to the previously active one"""
        assert self.qtile is not None
        group = self.qtile.groups_map.get(group_name if group_name else "")
        self._toggle_group(group, warp=warp)
Switch to the selected group or to the previously active one
libqtile/config.py