def _toggle_group(self, group: _Group | None = None, warp: bool = True) -> None:
        """Switch to the selected group or to the previously active one"""
        if group in (self.group, None) and self.previous_group:
            group = self.previous_group
        self.set_group(group, warp=warp)
Switch to the selected group or to the previously active one
libqtile/config.py